/* =====================================================
   晋金源教育科技 — Vibrant Premium Components
   ===================================================== */

/* =====================================================
   Premium Nav (Landing)
   ===================================================== */

.nav-landing {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.nav-landing-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.nav-landing.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--hairline);
  box-shadow: var(--shadow-sm);
}

.nav-landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-landing-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.nav-landing-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-landing-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.nav-landing-links a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-landing-cta {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.nav-landing-cta:hover {
  background: var(--primary-deep);
  box-shadow: var(--shadow-glow);
  color: #fff;
  transform: translateY(-1px);
}

.nav-landing-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-landing-links,
  .nav-landing-cta {
    display: none;
  }

  .nav-landing-menu-btn {
    display: flex;
  }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  padding: 100px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu a {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
}

.mobile-menu a:hover {
  color: var(--primary);
}

/* =====================================================
   Sidebar (Member / Admin)
   ===================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-soft);
  border-right: 1px solid var(--hairline);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--hairline);
}

.sidebar-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand-text {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-brand-text small {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 22px;
}

.sidebar-section-label {
  padding: 0 14px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-align: left;
}

.sidebar-item:hover {
  background: var(--bg-elevated);
  color: var(--ink);
}

.sidebar-item.active {
  background: var(--primary-soft);
  color: var(--primary-deep);
  box-shadow: inset 3px 0 0 0 var(--primary);
}

.sidebar-item .icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  transition: transform 0.2s var(--ease-out);
}

.sidebar-item:hover .icon {
  transform: scale(1.1);
}

.sidebar-bottom,
.nav-bottom {
  padding: 12px;
  border-top: 1px solid var(--hairline);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 12px;
  transition: background 0.2s;
}

.sidebar-user:hover {
  background: var(--bg-elevated);
}

.sidebar-user-name {
  font-weight: 700;
  color: var(--ink);
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--ink-muted);
}

/* =====================================================
   Main content area
   ===================================================== */

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.topbar-title span {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-search {
  position: relative;
}

.topbar-search input {
  width: 240px;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 13px;
  transition: all 0.2s;
}

.topbar-search input:focus {
  width: 300px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

.topbar-search::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.5;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}

.topbar-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.topbar-icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: none;
}

.topbar-icon-btn .dot.show {
  display: block;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-user:hover {
  border-color: var(--hairline-strong);
}

.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.topbar-user-role {
  font-size: 11px;
  color: var(--ink-muted);
}

.content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* =====================================================
   Page sections
   ===================================================== */

.page-section {
  margin-bottom: 32px;
}

.page-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hairline), transparent);
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-header p {
  font-size: 14px;
  color: var(--ink-muted);
}

/* =====================================================
   Dashboard stat cards
   ===================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.stat-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.gold::before { background: var(--accent); }
.stat-card.emerald::before { background: var(--emerald); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: var(--primary-soft); color: var(--primary-deep); }
.stat-card.gold .stat-icon { background: var(--accent-soft); color: var(--accent-deep); }
.stat-card.emerald .stat-icon { background: var(--emerald-soft); color: var(--emerald-deep); }
.stat-card.danger .stat-icon { background: var(--danger-soft); color: var(--danger-deep); }
.stat-card.info .stat-icon { background: var(--info-soft); color: #1d4ed8; }

.stat-body {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-trend {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up { color: var(--emerald); }
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--ink-muted); }

/* =====================================================
   Tabs
   ===================================================== */

.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  width: fit-content;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink-secondary);
}

.tab.active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s var(--ease-out);
}

.tab-panel.active {
  display: block;
}

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

/* =====================================================
   Modal
   ===================================================== */

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

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

.modal {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s var(--ease-out);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition: all 0.2s;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =====================================================
   Animation helpers
   ===================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-stagger].is-revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.gold-sheen {
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.55), rgba(245, 158, 11, 0.55), transparent);
  background-size: 200% 100%;
  animation: sheen 2.5s linear infinite;
}

@keyframes sheen {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =====================================================
   Mobile sidebar toggle
   ===================================================== */

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  cursor: pointer;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .topbar-search input {
    width: 160px;
  }

  .topbar-search input:focus {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
  }

  .topbar-search {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}
