:root, [data-theme="dark"] {
  --bg: #07080a; --bg2: #0d0f12; --surface: #13151a; --surface2: #1a1d24;
  --border: #23272f; --border2: #2d323c;
  --text: #f0f2f5; --text2: #a0a8b8; --text3: #6b7280;
  --accent: #3b82f6; --accent2: #2563eb; --accent-glow: rgba(59,130,246,0.15);
  --green: #22c55e; --red: #ef4444; --orange: #f59e0b;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  --elevated-shadow: 0 8px 24px rgba(0,0,0,0.45);
  --header-bg: rgba(7,8,10,0.85);
  --gradient-hero: linear-gradient(135deg, #0a1628 0%, #0f1b2e 40%, #0a0f1a 100%);
}
[data-theme="light"] {
  --bg: #eceff4; --bg2: #e1e6ee; --surface: #ffffff; --surface2: #f4f7fb;
  --border: #dde3ec; --border2: #c4ccd8;
  --text: #0b1220; --text2: #4a5568; --text3: #707a8a;
  --accent: #2563eb; --accent2: #1d4ed8; --accent-glow: rgba(37,99,235,0.12);
  --green: #16a34a; --red: #dc2626; --orange: #d97706;
  --card-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 30px -12px rgba(15,23,42,0.10);
  --elevated-shadow: 0 4px 12px -4px rgba(15,23,42,0.08), 0 18px 40px -16px rgba(15,23,42,0.16);
  --header-bg: rgba(236,239,244,0.85);
  --gradient-hero: linear-gradient(135deg, #dbeafe 0%, #eff6ff 40%, #f4f6f9 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7; min-height: 100vh;
  -webkit-font-smoothing: antialiased; direction: rtl;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent2); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent); }

/* ─── Top Bar ─── */
.top-bar {
  position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
  background: var(--header-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); height: 64px; display: flex; align-items: center;
}
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.brand .x { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--text2); align-items: center; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { color: var(--text2); padding: 8px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; transition: all .2s; }
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
#theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--text2); display: flex; align-items: center; transition: all .2s; }
#theme-toggle:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 22px; border-radius: 10px; font-weight: 600; font-size: 0.85rem; border: none; cursor: pointer; transition: all .25s; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 12px rgba(59,130,246,0.3); }
.btn-primary:hover { background: var(--accent2); box-shadow: 0 4px 20px rgba(59,130,246,0.4); transform: translateY(-1px); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--text2); border: none; padding: 8px 16px; }
.btn-ghost:hover { color: var(--text); background: var(--surface2); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 32px; font-size: 0.95rem; border-radius: 12px; }
.btn-danger { background: var(--red); color: #fff; }

/* ─── Hero ─── */
.hero { min-height: 520px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 120px 24px 60px; position: relative; overflow: hidden; background: var(--gradient-hero); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 50% at 50% 0%, var(--accent-glow), transparent); pointer-events: none; }
.hero-content { position: relative; z-index: 1; max-width: 780px; }
.hero-title { font-size: 2.8rem; font-weight: 900; line-height: 1.3; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero-sub { font-size: 1.05rem; color: var(--text2); max-width: 580px; margin: 0 auto 36px; line-height: 1.8; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ─── Sections ─── */
.section { padding: 80px 0; }
.section-title { font-size: 1.8rem; font-weight: 800; text-align: center; margin-bottom: 48px; }
.page-content { padding-top: 100px; padding-bottom: 60px; min-height: 70vh; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; }
.page-header p { color: var(--text2); margin-top: 4px; font-size: 0.9rem; }

/* ─── Product Grid ─── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: all .3s; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--accent); box-shadow: var(--card-shadow); transform: translateY(-3px); }
.product-card-img { aspect-ratio: 16/10; background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-icon { color: var(--text3); opacity: 0.3; }
.product-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.product-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; line-height: 1.5; }
.product-card-desc { font-size: 0.82rem; color: var(--text2); margin-bottom: 14px; flex: 1; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
.product-price { font-size: 0.95rem; font-weight: 700; color: var(--accent); }
.product-category { font-size: 0.72rem; padding: 3px 10px; border-radius: 6px; background: var(--accent-glow); color: var(--accent); font-weight: 600; }

/* ─── Articles ─── */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.article-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: all .3s; text-decoration: none; color: inherit; }
.article-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--card-shadow); }
.article-card-img { aspect-ratio: 16/9; background: var(--surface2); overflow: hidden; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; }
.article-card-body { padding: 18px; }
.article-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.article-card-summary { font-size: 0.82rem; color: var(--text2); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-date { font-size: 0.72rem; color: var(--text3); margin-top: 10px; }

/* ─── Auth ─── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 80px 16px; }
.auth-glow { position: fixed; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, var(--accent-glow), transparent 70%); top: 30%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.auth-card { position: relative; z-index: 10; width: 100%; max-width: 400px; padding: 2.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.auth-title { text-align: center; font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.88rem; outline: none; transition: all .2s; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-submit { width: 100%; padding: 12px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all .25s; }
.btn-submit:hover { background: var(--accent2); transform: translateY(-1px); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.82rem; color: var(--text3); }
.auth-footer a { color: var(--accent); font-weight: 500; }

/* ─── Detail ─── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.detail-image { width: 100%; aspect-ratio: 16/10; background: var(--surface2); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 12px; line-height: 1.4; }
.detail-category { display: inline-block; font-size: 0.75rem; padding: 4px 12px; border-radius: 6px; background: var(--accent-glow); color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.detail-desc { color: var(--text2); line-height: 1.9; margin-bottom: 24px; font-size: 0.9rem; }
.detail-price { font-size: 1.8rem; font-weight: 800; color: var(--accent); margin-bottom: 24px; }

/* ─── Article ─── */
.article-page { padding-top: 100px; padding-bottom: 60px; max-width: 760px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.article-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; line-height: 1.4; }
.article-page .meta { color: var(--text3); font-size: 0.82rem; margin-bottom: 32px; }
.article-page .content { line-height: 2; color: var(--text2); font-size: 0.95rem; }
.article-page .content p { margin-bottom: 16px; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.data-table th { background: var(--surface2); color: var(--text3); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:hover td { background: var(--surface2); }

.status-badge, .badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.status-completed, .badge-completed { background: rgba(34,197,94,0.12); color: var(--green); }
.status-pending, .badge-pending { background: rgba(245,158,11,0.12); color: var(--orange); }
.status-refunded { background: rgba(239,68,68,0.12); color: var(--red); }

/* ─── Footer ─── */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 40px 0 20px; }
.footer-inner { text-align: center; }
.footer-brand { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.footer-brand .x { color: var(--accent); }
.footer-desc { color: var(--text3); font-size: 0.82rem; margin-bottom: 12px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; }
.footer-links a { color: var(--text3); font-size: 0.82rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; color: var(--text3); font-size: 0.75rem; }

/* ─── Alerts ─── */
.alert { padding: 10px 18px; border-radius: 10px; font-size: 0.84rem; font-weight: 500; margin-bottom: 12px; }
.alert-error { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.flash-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 9000; width: 90%; max-width: 460px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); font-size: 0.9rem; }

/* ─── Grain ─── */
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.02; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ─── Section Heads ─── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-head h2 { font-size: 1.3rem; font-weight: 800; }
.link-more { font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.section-alt { background: var(--bg2); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ─── TV ─── */
.tv-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tv-cat-pill { padding: 7px 18px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; color: var(--text2); background: var(--surface); border: 1px solid var(--border); transition: all .2s; }
.tv-cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.tv-cat-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.tv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: all .3s; }
.tv-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--card-shadow); }
.tv-card-cover { aspect-ratio: 16/9; background: var(--surface2); overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.tv-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.tv-play-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); opacity: 0; transition: opacity .3s; border-radius: 0; }
.tv-card:hover .tv-play-icon { opacity: 1; }
.tv-card-body { padding: 14px 16px; }
.tv-card-body h3 { font-size: 0.88rem; font-weight: 700; margin-bottom: 4px; line-height: 1.5; }
.tv-card-cat { font-size: 0.72rem; color: var(--text3); }
.tv-player-wrap { margin-bottom: 24px; }
.tv-player-frame { width: 100%; aspect-ratio: 16/9; border-radius: 14px; border: 1px solid var(--border); }

/* ─── Courses ─── */
.course-header { margin-bottom: 32px; }
.course-cover { width: 100%; max-height: 350px; object-fit: cover; border-radius: 14px; margin-bottom: 20px; border: 1px solid var(--border); }
.badge-free { display: inline-block; background: rgba(34,197,94,0.12); color: var(--green); padding: 5px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 700; margin-top: 12px; }
.video-list { margin-bottom: 32px; }
.video-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all .2s; background: var(--surface); }
.video-item:hover, .video-item.active { border-color: var(--accent); background: var(--accent-glow); }
.video-item-num { font-size: 0.85rem; font-weight: 700; color: var(--text3); width: 24px; text-align: center; flex-shrink: 0; }
.video-item-info { flex: 1; }
.video-item-info h3 { font-size: 0.88rem; font-weight: 600; }
.video-duration { font-size: 0.72rem; color: var(--text3); }
.video-player { margin-top: 24px; }

/* ─── Downloads ─── */
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.download-cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: all .3s; }
.download-cat-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--card-shadow); }
.download-cat-cover { aspect-ratio: 4/3; background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.download-cat-cover img { width: 100%; height: 100%; object-fit: cover; }
.download-cat-info { padding: 16px; }
.download-cat-info h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.download-cat-info span { font-size: 0.75rem; color: var(--text3); }
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; font-size: 0.82rem; color: var(--text3); flex-wrap: wrap; }
.breadcrumb a { color: var(--accent); }
.sub-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: var(--text2); }
.download-items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.download-item-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.download-item-cover { aspect-ratio: 4/3; background: var(--surface2); overflow: hidden; }
.download-item-cover img { width: 100%; height: 100%; object-fit: cover; }
.download-item-info { padding: 14px; }
.download-item-info h3 { font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.file-type-badge { display: inline-block; font-size: 0.68rem; padding: 2px 8px; border-radius: 4px; background: var(--accent-glow); color: var(--accent); font-weight: 700; }

/* ─── Cart ─── */
.cart-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.cart-item-img { width: 80px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--surface2); flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; }
.cart-item-cat { font-size: 0.75rem; color: var(--text3); }
.cart-item-price { font-size: 0.95rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; position: sticky; top: 80px; }
.cart-summary h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.cart-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 0.85rem; color: var(--text2); }
.cart-total { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.cart-badge { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ─── Grid-3 ─── */
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ─── Students ─── */
.students-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.student-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; text-align: center; text-decoration: none; color: inherit; transition: all .3s; }
.student-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--card-shadow); }
.student-avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; margin: 0 auto 12px; }
.student-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.student-card span { font-size: 0.75rem; color: var(--text3); }

/* ─── Profile Public ─── */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; flex-shrink: 0; }
.profile-info h1 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.profile-info p { font-size: 0.88rem; color: var(--text2); margin-bottom: 4px; }
.profile-meta { font-size: 0.78rem; color: var(--text3); }

/* ─── Masonry (Pinterest-style) ─── */
.masonry-grid { columns: 2; column-gap: 20px; }
.masonry-item { break-inside: avoid; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.masonry-cover { width: 100%; display: block; }
.masonry-info { padding: 16px; }
.masonry-info h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.masonry-info p { font-size: 0.8rem; color: var(--text2); line-height: 1.6; }
.masonry-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; padding: 8px; }
.masonry-gallery img, .masonry-gallery video { width: 100%; border-radius: 6px; object-fit: cover; display: block; }
.masonry-gallery img { aspect-ratio: auto; }
.gallery-thumb { position: relative; display: inline-block; }
.gallery-thumb img, .gallery-thumb video { width: 100%; height: auto; max-height: 200px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.gallery-delete { position: absolute; top: 4px; left: 4px; }

/* ─── Customer Dashboard ─── */
.dash-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.dash-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; flex-shrink: 0; }
.dash-user-info h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.dash-user-info span { font-size: 0.82rem; color: var(--text3); }
.dash-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.dash-tab { padding: 12px 20px; font-size: 0.84rem; font-weight: 600; color: var(--text2); border-bottom: 2px solid transparent; transition: all .2s; text-decoration: none; }
.dash-tab:hover { color: var(--text); }
.dash-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.dash-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.dash-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.dash-stat-label { font-size: 0.78rem; color: var(--text3); font-weight: 500; }
.dash-section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.dash-purchases-list { display: flex; flex-direction: column; gap: 10px; }
.dash-purchase-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.dash-purchase-info { display: flex; flex-direction: column; gap: 2px; }
.dash-purchase-info strong { font-size: 0.88rem; }
.dash-purchase-info span { font-size: 0.75rem; color: var(--text3); }
.dash-purchase-meta { display: flex; align-items: center; gap: 12px; }
.dash-price { font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.license-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.license-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.license-product { font-size: 0.88rem; font-weight: 700; margin-bottom: 10px; }
.license-key { font-family: 'Courier New', monospace; font-size: 1.3rem; font-weight: 800; color: var(--accent); letter-spacing: 2px; margin-bottom: 12px; direction: ltr; text-align: center; padding: 12px; background: var(--accent-glow); border-radius: 8px; }
.license-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--text3); }
.license-status { background: rgba(34,197,94,0.12); color: var(--green); padding: 3px 10px; border-radius: 12px; font-weight: 700; font-size: 0.72rem; }

/* ─── License List (row) view ─── */
.license-list { display: flex; flex-direction: column; gap: 10px; }
.license-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  transition: border-color .18s;
}
.license-row:hover { border-color: var(--accent); }
.license-row-main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; flex-wrap: wrap; }
.license-row-main .license-product { margin-bottom: 0; min-width: 140px; }
.license-row-main .license-key {
  margin-bottom: 0; padding: 8px 14px; font-size: 1.05rem;
  letter-spacing: 1px; text-align: center;
}
.license-row-meta { display: flex; align-items: center; gap: 14px; font-size: 0.74rem; color: var(--text3); white-space: nowrap; }
.license-row-action { white-space: nowrap; }
.account-form { max-width: 600px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Software ─── */
.plugins-list { display: flex; flex-direction: column; gap: 10px; }
.plugin-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); }
.plugin-item strong { font-size: 0.85rem; }

/* ─── Pagination ─── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; margin: 2rem 0;
}
.pagination a, .pagination .current {
  padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.85rem;
}
.pagination a {
  border: 1px solid var(--border); color: var(--text);
  text-decoration: none; transition: all 0.2s;
}
.pagination a:hover {
  background: var(--accent); color: white; border-color: var(--accent);
}
.pagination .current {
  background: var(--accent); color: white;
}
.pagination .page-info {
  font-size: 0.82rem; color: var(--text3); padding: 0.4rem 0.8rem;
}

/* ─── Banner Section ─── */
.banners-section { margin-top: 40px; }
.banner-card {
  display: block; border-radius: 12px; padding: 1.5rem 2rem;
  margin: 1rem 0; text-decoration: none; color: white;
  transition: transform 0.2s, box-shadow 0.2s;
}
.banner-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  color: white;
}
.banner-gradient1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.banner-gradient2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.banner-gradient3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.banner-minimal { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.banner-minimal:hover { color: var(--text); }
.banner-dark { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.banner-content h3 { font-size: 1.2rem; margin-bottom: 0.5rem; font-weight: 700; }
.banner-content p { font-size: 0.9rem; opacity: 0.9; margin-bottom: 1rem; }
.banner-cta {
  display: inline-block; padding: 0.4rem 1rem; border-radius: 6px;
  background: rgba(255,255,255,0.2); font-size: 0.85rem; font-weight: 600;
}
.banner-minimal .banner-cta { background: var(--accent-glow); color: var(--accent); }

/* ─── Badge Icons (SVG-based) ─── */
.badge-icon {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; padding: 0.2rem 0.6rem;
  border-radius: 20px; font-weight: 500;
}
.badge-bronze { background: rgba(205,127,50,0.15); color: #CD7F32; }
.badge-silver { background: rgba(192,192,192,0.15); color: #808080; }
.badge-gold { background: rgba(255,215,0,0.15); color: #B8860B; }
.badge-diamond { background: rgba(185,242,255,0.15); color: #0099CC; }
.badge-vip { background: rgba(155,89,182,0.15); color: #9B59B6; }
.badge-icon .badge-svg { width: 14px; height: 14px; flex-shrink: 0; }
.badge-icon .badge-svg path,
.badge-icon .badge-svg polygon { fill: currentColor; }

/* ─── Dashboard Layout with Sidebar ─── */
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.dash-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 8px; position: sticky; top: 80px;
}
.dash-sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 0.84rem; font-weight: 500;
  color: var(--text2); text-decoration: none; transition: all .2s;
}
.dash-sidebar-link:hover { background: var(--surface2); color: var(--text); }
.dash-sidebar-link.active {
  background: var(--accent-glow); color: var(--accent); font-weight: 600;
}
.dash-sidebar-link svg { width: 18px; height: 18px; min-width: 18px; max-width: 18px; opacity: 0.7; flex-shrink: 0; }
.dash-sidebar-link.active svg { opacity: 1; }
.dash-main-content { min-width: 0; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .cart-wrap { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .dash-layout { grid-template-columns: 200px 1fr; gap: 20px; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 56px; right: 0; left: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; gap: 2px; box-shadow: var(--card-shadow); z-index: 999; }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 16px; width: 100%; border-radius: 8px; }
  .hero-title { font-size: 1.8rem; }
  .hero { min-height: 400px; padding: 100px 16px 40px; }
  .section { padding: 48px 0; }
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .top-bar { height: 56px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .tv-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .download-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .download-items-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .license-grid { grid-template-columns: 1fr; }
  .license-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .license-row-main { flex-direction: column; align-items: stretch; gap: 10px; }
  .license-row-main .license-key { font-size: 1.2rem; letter-spacing: 2px; }
  .license-row-meta { justify-content: space-between; flex-wrap: wrap; }
  .dash-purchase-item { flex-direction: column; gap: 10px; align-items: flex-start; }
  .masonry-grid { columns: 1; }
  .students-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cart-item { flex-wrap: wrap; }

  .dash-layout { grid-template-columns: 1fr; gap: 0; }
  .dash-sidebar {
    position: static; border-radius: 14px 14px 0 0;
    padding: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .dash-sidebar-nav {
    flex-direction: row; gap: 4px; flex-wrap: nowrap;
    min-width: max-content;
  }
  .dash-sidebar-link {
    white-space: nowrap; padding: 8px 14px; font-size: 0.78rem;
    border-radius: 8px;
  }
  .dash-sidebar-link svg { display: none; }
  .dash-main-content { margin-top: 0; }
}

/* ── Addix Plugin Dropdown ── */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 20px;
}
.nav-dropdown-trigger {
  display: flex !important;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-trigger svg {
  transition: transform 0.3s ease;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 50%;
  transform: translateX(50%) translateY(8px);
  display: none;
  opacity: 0;
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 16px;
  padding: 16px;
  min-width: 300px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  z-index: 1000;
  backdrop-filter: blur(20px);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
  animation: dropdownFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.nav-dropdown:hover .nav-dropdown-trigger svg,
.nav-dropdown.open .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateX(50%) translateY(8px); }
  to { opacity: 1; transform: translateX(50%) translateY(0); }
}
.nav-dropdown-header {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
  margin-bottom: 14px;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #2a2a4a);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-main, #fff);
  transition: all 0.2s ease;
  margin-bottom: 4px;
}
.nav-dropdown-item:last-child {
  margin-bottom: 0;
}
.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  transform: translateX(-4px);
}
.nav-dropdown-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-dropdown-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.nav-dropdown-desc {
  font-size: 0.72rem;
  color: var(--text-secondary, #aaa);
}

@media (max-width: 768px) {
  .nav-dropdown {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nav-dropdown::after { display: none; }
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-right: 2px solid var(--accent-glow);
    border-radius: 0;
    margin: 4px 14px 6px;
    padding: 4px 10px 4px 0;
    background: transparent;
    min-width: auto;
    width: auto;
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block !important;
    transform: none;
    animation: none;
    opacity: 1;
  }
  .nav-dropdown-header { text-align: right; font-size: 0.74rem; margin-bottom: 8px; padding-bottom: 8px; }
  .nav-dropdown-item { padding: 10px 8px; }
  .nav-dropdown-item:hover { transform: none; }
  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
  }
  .nav-links {
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
}

/* ── AI assistant sidebar link ── */
.dash-ai-link { position: relative; }
.dash-ai-badge {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  margin-inline-start: auto;
}
