/* =========================================================
   IVAC Pro Dashboard - Modern Aesthetics & Design System
   ========================================================= */

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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.04) 0%, transparent 40%),
    linear-gradient(#f1f5f9 1px, transparent 1px),
    linear-gradient(90deg, #f1f5f9 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-item a {
  text-decoration: none;
  color: var(--text-body);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

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

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

.nav-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid var(--success-border);
  color: #065f46;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-balance-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

/* LAYOUT CONTAINER */
.main-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 30px auto;
  padding: 0 20px;
  flex: 1;
}

/* CARDS */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
  margin-bottom: 24px;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-body);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

/* FORM CONTROLS */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.indigo {
  background: #eef2ff;
  color: #4f46e5;
}

.stat-icon.emerald {
  background: #ecfdf5;
  color: #10b981;
}

.stat-icon.amber {
  background: #fffbeb;
  color: #d97706;
}

.stat-icon.rose {
  background: #fef2f2;
  color: #ef4444;
}

.stat-info {
  flex: 1;
}

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

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 2px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-body);
}

.table tr:hover td {
  background: #f8fafc;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0e7ff; color: #3730a3; }

/* PRICING PACKAGES GRID */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.package-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.package-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.package-card.popular {
  border: 2px solid var(--primary);
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.15);
}

.package-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gradient);
  color: white;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.package-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 6px;
}

.package-credits {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary);
  margin: 14px 0 6px;
}

.package-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.package-original-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

/* FLASH ALERTS */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* FOOTER */
.footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
}
