:root {
  --bg-color: #0f172a;
  --bg-accent: #1e293b;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(30, 41, 59, 0.6);
  --font-family: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Animated Blobs for depth */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.4;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: var(--info);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(50px) scale(1.1); }
  100% { transform: translateY(-30px) scale(0.9); }
}

/* Glassmorphism System */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hidden {
  display: none !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
}

/* Typography & Links */
h2, h3 { font-weight: 600; }
p, label { color: var(--text-muted); font-size: 0.95rem; }
a { color: var(--primary); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--text-main); }

/* Forms & Inputs */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease-in-out;
  outline: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.secondary-btn {
  background: var(--bg-accent);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.accent-btn {
  background: linear-gradient(135deg, var(--info), #2563eb);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.text-btn {
  background: transparent;
  color: var(--text-muted);
}
.text-btn:hover { color: var(--text-main); }

.icon-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
}
.icon-btn:hover {
  background: var(--glass-border);
  color: var(--text-main);
}

/* Login Screen */
.auth-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.logo-area {
  margin-bottom: 30px;
}

.logo-area i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 12px;
  filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.4));
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 20px;
  margin-top: 12px;
}

/* Dashboard Layout */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-branding i {
  color: var(--primary);
  font-size: 1.5rem;
}

.nav-branding span {
  font-weight: 400;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.vendor-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.dashboard-content {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Grid Widgets */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.widget {
  display: flex;
  align-items: center;
  gap: 20px;
}

.widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.widget-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.widget-icon.primary { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.widget-icon.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.widget-icon.info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

.widget-info h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 4px; }
.widget-info p { font-size: 2rem; font-weight: 700; color: var(--text-main); line-height: 1; }

/* Generators */
.generator-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.generator-card {
  display: flex;
  flex-direction: column;
}

.generator-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.generator-card .desc {
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Codes Table */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.table-responsive {
  overflow-x: auto;
}

.codes-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.codes-table th, .codes-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.codes-table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.codes-table tbody tr {
  transition: background 0.2s;
}

.codes-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-spec { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
.badge-univ { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }

/* Code Snippet Display */
.code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-color);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
}

.code-display code {
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--success);
  letter-spacing: 2px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s;
}

.modal-box {
  width: 100%;
  max-width: 450px;
  text-align: center;
}

.modal-box h3 { margin-bottom: 10px; }
.success-text { color: var(--success); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: var(--bg-color);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error { background: var(--danger); color: white; }
.toast.success { background: var(--success); color: white; }

/* Loader Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(124, 58, 237, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mt-4 { margin-top: 16px; }
.w-full { width: 100%; top: 0; }
