/* AZ Creator Member Portal & Admin Dashboard - Modern Dark Theme */
:root {
  --bg-main: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-card: #141e33;
  --bg-card-hover: #1a2742;
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-input: #0b1120;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #00f2ea;
  --accent-teal: #14b8a6;
  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --badge-yellow: #facc15;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(0, 242, 234, 0.2);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

code {
  font-family: 'JetBrains Mono', monospace;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: var(--transition);
}

.sidebar.collapsed {
  width: 72px;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #041017;
  font-size: 1.1rem;
  box-shadow: 0 2px 10px rgba(0, 242, 234, 0.3);
}

.brand-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .tag-vip,
.sidebar.collapsed .tag-soon,
.sidebar.collapsed .profile-info {
  display: none;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 10px;
  margin-bottom: 6px;
}

.admin-title {
  color: var(--accent-cyan);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-link.active {
  background: rgba(0, 242, 234, 0.1);
  color: var(--accent-cyan);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-link-admin {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
}

.nav-link-admin:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
}

.nav-disabled {
  opacity: 0.55;
  cursor: pointer;
}

.nav-icon {
  font-size: 1.1rem;
  width: 22px;
  display: flex;
  justify-content: center;
}

.tag-vip {
  margin-left: auto;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.tag-soon {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.tag-vip-mini {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Sidebar Profile Footer */
.sidebar-profile {
  padding: 16px 14px;
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.profile-tier-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: #fff;
}

.profile-email {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--accent-red);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: var(--transition);
}

.btn-logout:hover {
  filter: brightness(1.2);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 32px 36px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.page-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeIn 0.25s ease-in-out;
}

.page-view.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* View Headers */
.view-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.view-header.flex-between {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.view-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Dashboard Header Card */
.dashboard-header-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.welcome-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.welcome-text h1 span {
  color: #fff;
}

.welcome-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.tier-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Stats 3-Card Row */
.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.stat-box:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.stat-box-icon {
  font-size: 1.8rem;
}

.stat-box-data h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.stat-box-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Quick Access Section */
.quick-access-section, .announcements-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.quick-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.quick-card:hover .quick-arrow {
  transform: translateX(4px);
  color: var(--accent-cyan);
}

.quick-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.icon-blue { background: rgba(56, 189, 248, 0.12); }
.icon-purple { background: rgba(168, 85, 247, 0.12); }
.icon-green { background: rgba(16, 185, 129, 0.12); }
.icon-pink { background: rgba(236, 72, 153, 0.12); }
.icon-cyan { background: rgba(0, 242, 234, 0.12); }
.icon-amber { background: rgba(245, 158, 11, 0.12); }
.icon-gray { background: rgba(148, 163, 184, 0.12); }

.quick-card-body h3 {
  font-size: 0.96rem;
  font-weight: 600;
}

.quick-card-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.quick-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition);
}

/* Announcements Box */
.announcements-list {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.announcement-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bullet-dot {
  font-size: 0.8rem;
  line-height: 1.6;
}

.bullet-dot.cyan { color: var(--accent-cyan); }
.bullet-dot.orange { color: var(--accent-orange); }
.bullet-dot.green { color: var(--accent-green); }

.ann-content strong {
  font-size: 0.88rem;
  color: #fff;
}

.ann-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Cards & Generic Components */
.content-card, .download-card, .my-license-card, .referral-box, .placeholder-card, .tier-features-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

/* ========================================================= */
/* AZ GEMS HUB (3x3 Grid & Modern Styling) */
/* ========================================================= */

.gems-hub-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gems-main-title {
  font-size: 1.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gems-sparkle-icon {
  color: var(--accent-cyan);
}

.gems-title-text {
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gems-main-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.az-gems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gem-card {
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.gem-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.7);
}

/* Corner Glow variations */
.gem-card.glow-teal {
  background: radial-gradient(circle at top right, rgba(20, 184, 166, 0.15), rgba(17, 24, 39, 0.75) 65%);
}
.gem-card.glow-amber {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.15), rgba(17, 24, 39, 0.75) 65%);
}
.gem-card.glow-purple {
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.15), rgba(17, 24, 39, 0.75) 65%);
}
.gem-card.glow-orange {
  background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.15), rgba(17, 24, 39, 0.75) 65%);
}
.gem-card.glow-pink {
  background: radial-gradient(circle at top right, rgba(244, 63, 94, 0.15), rgba(17, 24, 39, 0.75) 65%);
}

.gem-card-badge {
  position: absolute;
  top: 16px;
  left: 18px;
  background: var(--badge-yellow);
  color: #1f2937;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.gem-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-top: 26px;
  flex-shrink: 0;
}

.gem-icon-box.teal {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.35);
}

.gem-icon-box.amber {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.gem-icon-box.purple {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.gem-icon-box.orange {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.gem-icon-box.pink {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.gem-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.gem-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  min-height: 48px;
}

.gem-card-footer {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gem-quota-text {
  font-size: 0.75rem;
  color: #64748b;
}

.gem-cta-btn {
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
  align-self: flex-start;
}

.gem-cta-btn.teal { color: #2dd4bf; }
.gem-cta-btn.amber { color: #fbbf24; }
.gem-cta-btn.purple { color: #c084fc; }
.gem-cta-btn.orange { color: #fb923c; }
.gem-cta-btn.pink { color: #fb7185; }

.gem-card:hover .gem-cta-btn {
  gap: 8px;
}

/* Tier Permissions Card (สิทธิ์ตาม Tier) */
.tier-features-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tier-features-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-features-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feature-item-card {
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.feature-item-card.unlocked {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.feature-item-card.locked {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0.55;
}

.feature-status-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.feature-item-card.unlocked .feature-status-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.feature-item-card.locked .feature-status-icon {
  background: rgba(255, 255, 255, 0.06);
  color: #f59e0b;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-meta {
  display: flex;
  flex-direction: column;
}

.feature-meta strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.feature-item-card.locked .feature-meta strong {
  color: var(--text-secondary);
}

.feature-meta span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.feature-item-card.locked .feature-meta span {
  color: var(--text-muted);
}

.download-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.ext-badge-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.version-tag {
  background: rgba(0, 242, 234, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 234, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
}

.install-steps {
  background: rgba(0, 0, 0, 0.25);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-top: 20px;
}

.install-steps ol {
  padding-left: 20px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

/* Tutorials & Products Grid */
.tutorials-grid, .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tutorial-card, .product-item-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.tutorial-card:hover, .product-item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.tut-thumbnail {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

.tut-body, .product-item-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prod-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.prod-icon {
  font-size: 2rem;
  margin: 4px 0;
}

/* My License Card & Quotas Preview */
.my-license-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.license-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.key-cell-lg {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.key-cell-lg code {
  font-size: 1.1rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.tier-pill-lg {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(0, 242, 234, 0.2));
  border: 1px solid rgba(0, 242, 234, 0.4);
  color: #fff;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.license-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
}

.quota-bars-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.q-meter {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bg-card-border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.q-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.q-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.bind-license-form {
  display: flex;
  gap: 14px;
  border-top: 1px solid var(--bg-card-border);
  padding-top: 20px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 12px;
}

.admin-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.admin-tab.active {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.2s;
}

.admin-section.hidden {
  display: none;
}

/* Tickets & Chat Thread */
.tickets-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-item-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.ticket-item-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.ticket-meta-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.ticket-meta-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.ticket-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-bubble.admin {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.3);
  align-self: flex-start;
}

.chat-bubble.user {
  background: rgba(0, 242, 234, 0.15);
  border: 1px solid rgba(0, 242, 234, 0.3);
  align-self: flex-end;
}

.chat-sender {
  font-size: 0.74rem;
  font-weight: 700;
}

/* Auth Modal */
.auth-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.auth-modal-backdrop.hidden {
  display: none;
}

.auth-modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #041017;
  box-shadow: 0 0 20px rgba(0, 242, 234, 0.4);
}

.auth-brand h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.auth-brand h2 span {
  color: var(--accent-cyan);
}

.auth-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden {
  display: none;
}

.btn-block {
  width: 100%;
  padding: 11px;
}

.demo-accounts-bar {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-demo-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-demo-chip:hover {
  background: rgba(0, 242, 234, 0.15);
  color: var(--accent-cyan);
}

/* Forms & Tables */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.form-input, .select-input {
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus, .select-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 242, 234, 0.2);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--bg-card-border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 9px 14px 9px 36px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-cyan);
}

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-max { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-pro { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.4); }
.badge-plus { background: rgba(0, 242, 234, 0.2); color: #67e8f9; border: 1px solid rgba(0, 242, 234, 0.4); }
.badge-free { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
}

.status-badge.active, .status-badge.open { color: var(--accent-green); }
.status-badge.in_progress { color: var(--accent-amber); }
.status-badge.closed, .status-badge.banned { color: var(--accent-red); }

/* Buttons */
.btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #041017;
  box-shadow: 0 4px 14px rgba(0, 242, 234, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-copy {
  background: rgba(0, 242, 234, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 234, 0.3);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-copy:hover {
  background: rgba(0, 242, 234, 0.25);
}

.btn-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-chip:hover {
  background: rgba(0, 242, 234, 0.15);
  color: var(--accent-cyan);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: white;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  background: #111827;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.2s;
}

.modal-dialog.modal-lg {
  max-width: 640px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #111827;
  z-index: 10;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover { color: #fff; }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.key-result-box {
  background: rgba(0, 242, 234, 0.05);
  border: 1px solid rgba(0, 242, 234, 0.25);
  padding: 18px;
  border-radius: var(--radius-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.key-details-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s;
}

.toast.hidden { display: none; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-xs { font-size: 0.75rem; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .az-gems-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 72px;
  }
  .sidebar .brand-title,
  .sidebar .nav-text,
  .sidebar .nav-section-title,
  .sidebar .tag-vip,
  .sidebar .tag-soon,
  .sidebar .profile-info {
    display: none;
  }
  .stats-cards-row {
    grid-template-columns: 1fr;
  }
  .tier-features-grid {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 20px 16px;
  }
}

@media (max-width: 640px) {
  .az-gems-grid {
    grid-template-columns: 1fr;
  }
}
