:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-dark); color: var(--text-main); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--primary-hover); }

/* Utilities */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.d-flex, .flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.p-0 { padding: 0; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.text-white { color: #fff; }
.text-muted, .text-slate-400 { color: var(--text-muted); }
.text-slate-500 { color: #64748b; }
.text-slate-300 { color: #cbd5e1; }
.text-primary, .text-indigo-400 { color: var(--primary); }
.text-danger, .text-red-500 { color: var(--danger); }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-full { max-width: 100%; }

.bg-slate-900 { background-color: #0f172a; }
.bg-slate-800 { background-color: var(--bg-card); }
.bg-slate-700 { background-color: #334155; }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-slate-600:hover { background-color: #475569; }
.hover\:bg-red-500:hover { background-color: var(--danger); }
.hover\:text-white:hover { color: #fff; }

.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-slate-700 { border-color: var(--border-color); }
.border-slate-600 { border-color: #475569; }
.border-dashed { border-style: dashed; }
.border-2 { border-width: 2px; }
.border-red-500\/20 { border-color: rgba(239, 68, 68, 0.2); }
.hover\:border-slate-600:hover { border-color: #475569; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-2 { top: 0.5rem; }
.right-2 { right: 0.5rem; }
.fixed { position: fixed; }
.bottom-4 { bottom: 1rem; }
.right-4 { right: 1rem; }
.z-50 { z-index: 50; }
.inline-block { display: inline-block; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.hover-border-primary:hover { border-color: var(--primary); border-style: solid; }
.transition-colors { transition-property: background-color, border-color, color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Nav */
.navbar { background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); padding: 1rem 0; }
.logo { font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: -0.5px; }

/* Forms & Inputs */
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; color: #cbd5e1; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color); border-radius: 0.5rem; background-color: #0f172a; color: #fff; font-family: inherit; font-size: 1rem; transition: border-color 0.2s; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); }
.input-group { display: flex; align-items: stretch; border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--border-color); }
.input-group .addon { background: var(--bg-card); padding: 0.75rem 1rem; color: var(--text-muted); border-right: 1px solid var(--border-color); display: flex; align-items: center; }
.input-group input { border: none; border-radius: 0; }
.input-group input:focus { box-shadow: inset 0 0 0 1px var(--primary); }
hr.divider { border: 0; border-top: 1px solid var(--border-color); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1.25rem; font-weight: 500; font-size: 0.95rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.btn-primary { background-color: var(--primary); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: #334155; color: #fff; border-color: #475569; }
.btn-secondary:hover { background-color: #475569; }
.btn-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background-color: var(--danger); color: #fff; }
.btn-outline { background-color: transparent; border-color: #475569; color: #cbd5e1; }
.btn-outline:hover { background-color: #334155; color: #fff; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.btn-large { padding: 0.875rem 2rem; font-size: 1.125rem; }
.btn-block { width: 100%; display: flex; }
button:disabled { opacity: 0.7; cursor: not-allowed; }

/* Cards & Auth */
.card { background-color: var(--bg-card); border-radius: 0.75rem; padding: 1.5rem; border: 1px solid var(--border-color); }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.auth-container { width: 100%; max-width: 28rem; }
.auth-card { background: var(--bg-card); padding: 2.5rem 2rem; border-radius: 1rem; border: 1px solid var(--border-color); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); }
.auth-card h1 { text-align: center; margin-bottom: 0.5rem; }
.auth-card h2 { text-align: center; color: var(--text-muted); font-size: 1rem; font-weight: 400; margin-bottom: 2rem; }
.auth-card .form-group { margin-bottom: 1.25rem; }
.auth-links { margin-top: 1.5rem; text-align: center; font-size: 0.9rem; color: var(--text-muted); }

/* Alerts */
.alert { padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem; font-size: 0.95rem; }
.alert-error { background-color: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-success { background-color: rgba(16, 185, 129, 0.1); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.2); }

/* Hero */
.hero { padding: 6rem 1rem; }
.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 1.5rem; background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 1.25rem; max-width: 48rem; margin: 0 auto; line-height: 1.6; }

/* Dashboard Creation Grid */
@media (max-width: 768px) {
  .creation-grid { flex-direction: column; }
  .preview-section { max-width: 100% !important; margin-top: 2rem; position: static !important; }
}

/* Toast */
.toast-container { pointer-events: none; }
.toast { background: var(--bg-card); color: #fff; padding: 1rem 1.5rem; border-radius: 0.5rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5); border-left: 4px solid var(--primary); min-width: 250px; pointer-events: auto; transform: translateX(100%); opacity: 0; transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); display: flex; align-items: center; justify-content: space-between; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
