:root {
  --sidebar: #172033;
  --sidebar-soft: #22304a;
  --accent: #0d6efd;
  --surface: #ffffff;
  --line: #e5e7eb;
  --text: #172033;
  --muted: #64748b;
  --bg: #f4f7fb;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.auth-bg {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,247,251,.94)),
    url("https://images.unsplash.com/photo-1604719312566-8912e9227c6a?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar);
  color: #fff;
  padding: 18px;
}

.admin-sidebar {
  background: #111827;
}

.brand {
  display: block;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 10px 20px;
}

.sidebar .nav-link {
  color: rgba(255,255,255,.82);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
}

.sidebar .nav-link:hover {
  background: var(--sidebar-soft);
  color: #fff;
}

.sidebar .bi {
  width: 22px;
  display: inline-block;
}

.content {
  flex: 1;
  min-width: 0;
}

.topbar {
  min-height: 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
}

.topbar__start {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar__user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar__user strong,
.topbar__user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  flex-shrink: 0;
}

.sidebar-toggle .bi {
  font-size: 1.35rem;
  line-height: 1;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.48);
}

.sidebar-backdrop.is-visible {
  display: block;
}

body.sidebar-open {
  overflow: hidden;
}

.page-main {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
}

.panel,
.stat-card,
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
}

.panel {
  padding: 20px;
}

.panel .table-responsive {
  margin: 0 -4px;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 575.98px) {
  .panel {
    padding: 14px;
  }

  .panel .table th,
  .panel .table td {
    white-space: nowrap;
    font-size: 0.88rem;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .table-actions .btn {
    width: 100%;
  }
}

.stat-card {
  min-height: 118px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: 24px;
}

.stat-card .bi {
  font-size: 22px;
  color: var(--accent);
}

.product-card {
  overflow: hidden;
  height: 100%;
}

.product-media,
.product-hero {
  min-height: 210px;
  background: linear-gradient(135deg, #e6f0ff, #f6f8fb);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 58px;
}

.product-hero {
  min-height: 420px;
  border-radius: 8px;
}

.referral-input {
  max-width: 460px;
}

.status-pending { background: #ffc107; color: #111; }
.status-approved { background: #198754; }
.status-rejected { background: #dc3545; }

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tree-view ul {
  list-style: none;
  border-left: 1px solid var(--line);
  margin-left: 16px;
  padding-left: 18px;
}

.tree-view li {
  margin: 10px 0;
}

.tree-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tree-toggle {
  border: 0;
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  line-height: 1;
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: inline-flex;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 300px);
    min-width: 0;
    z-index: 1050;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  }

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

  .sidebar .nav {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .topbar {
    padding: 10px 14px;
    min-height: 56px;
  }

  .page-main {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .referral-input {
    max-width: 100%;
  }
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
  }
}

@media (max-width: 575.98px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .member-dashboard-head {
    flex-direction: column;
    align-items: stretch !important;
  }

  .member-dashboard-head__id {
    text-align: left !important;
    width: 100%;
  }
}

.public-site {
  background: #fff;
}

.public-nav {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #e7e2d5;
  backdrop-filter: blur(10px);
}

.public-brand {
  color: #0b1f3a;
  font-weight: 800;
  letter-spacing: 0;
}

.public-nav .nav-link {
  color: #0b1f3a;
  font-weight: 600;
}

.cart-link {
  position: relative;
}

.cart-link span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  background: #c8a24a;
  color: #0b1f3a;
  font-size: 12px;
  font-weight: 800;
}

.btn-gold {
  background: #c8a24a;
  border-color: #c8a24a;
  color: #0b1f3a;
  font-weight: 800;
}

.btn-gold:hover {
  background: #b89034;
  border-color: #b89034;
  color: #0b1f3a;
}

.hero-carousel,
.hero-slide {
  min-height: 620px;
}

.hero-slide,
.page-hero {
  color: #fff;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.page-hero {
  display: flex;
}

.carousel-item.hero-slide {
  display: none;
}

.carousel-item.hero-slide.active,
.carousel-item-next.hero-slide,
.carousel-item-prev.hero-slide {
  display: flex;
}

.hero-slide::before,
.page-hero::before,
.category-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11,31,58,.78), rgba(11,31,58,.2));
}

.mens-slide {
  background-image: url("https://images.unsplash.com/photo-1617127365659-c47fa864d8bc?auto=format&fit=crop&w=1800&q=80");
}

.saree-slide {
  background-image: url("https://images.unsplash.com/photo-1610030469983-98e550d6193c?auto=format&fit=crop&w=1800&q=80");
}

.business-hero,
.compact-hero {
  min-height: 360px;
  background-image: url("https://images.unsplash.com/photo-1558769132-cb1aea458c5e?auto=format&fit=crop&w=1800&q=80");
}

.hero-copy,
.page-hero .container {
  position: relative;
  z-index: 1;
}

.hero-copy p,
.page-hero p,
.eyebrow {
  color: #c8a24a;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-copy h1,
.page-hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1;
  margin-bottom: 28px;
}

.public-section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.public-section h2 {
  color: #0b1f3a;
  font-weight: 800;
}

.soft-band {
  background: #f7f8fb;
}

.dark-band {
  background: #0b1f3a;
  color: #fff;
}

.dark-band h2 {
  color: #fff;
}

.value-grid,
.icon-grid {
  display: grid;
  gap: 16px;
}

.value-grid {
  grid-template-columns: repeat(3, 1fr);
}

.value-grid div,
.icon-grid div,
.quote-card,
.shop-card,
.calculator {
  border: 1px solid #e7e2d5;
  border-radius: 8px;
  background: #fff;
}

.value-grid div {
  padding: 18px;
}

.value-grid span {
  display: block;
  color: #64748b;
  margin-top: 8px;
}

.icon-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.icon-grid div {
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-grid i {
  color: #c8a24a;
  font-size: 24px;
}

.category-tile {
  min-height: 280px;
  display: flex;
  align-items: end;
  padding: 28px;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
}

.mens-tile {
  background-image: url("https://images.unsplash.com/photo-1617127365659-c47fa864d8bc?auto=format&fit=crop&w=1200&q=80");
}

.saree-tile {
  background-image: url("https://images.unsplash.com/photo-1610030469983-98e550d6193c?auto=format&fit=crop&w=1200&q=80");
}

.category-tile span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 800;
}

.quote-card {
  padding: 24px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-card.dark {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.2);
}

.shop-card {
  height: 100%;
  overflow: hidden;
  box-shadow: 0 18px 34px rgba(11,31,58,.08);
}

.shop-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.shop-card-body {
  padding: 18px;
}

.shop-card h3 {
  font-size: 18px;
  min-height: 44px;
  margin: 6px 0;
}

.rating {
  color: #c8a24a;
  font-weight: 700;
}

.shop-filter {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr 1fr auto;
  gap: 10px;
}

.product-gallery .zoom-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.gallery-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.qty-input {
  max-width: 90px;
}

.spec-box {
  border-top: 1px solid #e7e2d5;
  padding-top: 18px;
}

.spec-box pre {
  white-space: pre-wrap;
  font-family: inherit;
  color: #475569;
}

.review-row,
.related-row,
.summary-row {
  border-bottom: 1px solid #e7e2d5;
  padding: 12px 0;
}

.related-row,
.summary-row,
.cart-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.related-row {
  color: #0b1f3a;
  text-decoration: none;
}

.cart-summary {
  align-items: center;
}

.payment-box,
.map-placeholder {
  min-height: 160px;
  border: 1px dashed #c8a24a;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fbf7ec;
  color: #0b1f3a;
  font-weight: 700;
}

.sticky-summary {
  position: sticky;
  top: 96px;
}

.summary-row.total {
  font-size: 20px;
}

.matrix-visual {
  min-height: 280px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: center;
}

.matrix-visual span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0b1f3a;
  color: #c8a24a;
  font-size: 28px;
  font-weight: 800;
}

.calc-output {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.calc-output div {
  padding: 18px;
  border-radius: 8px;
  background: #f7f8fb;
}

.calc-output span {
  display: block;
  color: #64748b;
}

.calc-output strong {
  font-size: 22px;
}

.public-footer {
  padding: 52px 0;
  background: #071426;
  color: rgba(255,255,255,.82);
}

.public-footer a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.blog-card span {
  color: #c8a24a;
  font-weight: 800;
  text-transform: uppercase;
}

.testimonial-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(200,162,74,.22), transparent 18rem),
    radial-gradient(circle at 88% 18%, rgba(11,31,58,.08), transparent 24rem),
    linear-gradient(180deg, #ffffff, #eef3f8);
}

.testimonial-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,.72), transparent 42%),
    repeating-linear-gradient(90deg, rgba(11,31,58,.025) 0 1px, transparent 1px 92px);
  pointer-events: none;
}

.testimonial-section .container {
  position: relative;
  z-index: 1;
}

.testimonial-head {
  align-items: end;
}

.testimonial-head h2 {
  margin-bottom: 0;
}

.testimonial-head > span {
  max-width: 420px;
  color: var(--slate);
  font-weight: 650;
}

.testimonial-card {
  min-height: 280px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  background:
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.62)),
    radial-gradient(circle at 15% 8%, rgba(200,162,74,.16), transparent 16rem);
}

.testimonial-card::before {
  content: "";
  position: absolute;
  inset: auto 22px 0 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,162,74,.62), transparent);
}

.testimonial-card .quote-mark {
  position: absolute;
  top: 4px;
  right: 24px;
  color: rgba(200,162,74,.18);
  font-family: Georgia, serif;
  font-size: 120px;
  line-height: 1;
  z-index: 0;
}

.testimonial-card .stars {
  color: var(--gold-500);
  font-size: 14px;
  letter-spacing: .08em;
  margin-bottom: 18px;
}

.testimonial-card p {
  color: #243044;
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 28px;
}

.reviewer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}

.reviewer > span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f2d58a, var(--gold-500));
  color: var(--navy-950);
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(200,162,74,.22), inset 0 1px 0 rgba(255,255,255,.55);
}

.reviewer strong {
  display: block;
  color: var(--navy-900);
  font-size: 16px;
}

.reviewer small {
  color: var(--slate);
  font-weight: 700;
}

.featured-testimonial {
  transform: translateY(-12px);
  border-color: rgba(200,162,74,.42);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(200,162,74,.12), 0 26px 90px rgba(200,162,74,.18);
}

.featured-testimonial:hover {
  transform: translateY(-16px);
}

@media (max-width: 992px) {
  .shop-filter,
  .value-grid,
  .calc-output {
    grid-template-columns: 1fr;
  }
  .hero-carousel,
  .hero-slide {
    min-height: 540px;
  }

  .testimonial-head {
    align-items: start;
  }

  .testimonial-head > span {
    max-width: none;
  }

  .featured-testimonial {
    transform: none;
  }

  .featured-testimonial:hover {
    transform: translateY(-4px);
  }
}

/* Premium liquid-glass refinement layer */
:root {
  --navy-950: #071426;
  --navy-900: #0b1f3a;
  --navy-800: #102b4c;
  --gold-500: #c8a24a;
  --gold-600: #b89034;
  --gold-soft: #f7efd9;
  --ink: #101827;
  --slate: #5d6b82;
  --cloud: #f6f8fb;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-dark: rgba(7, 20, 38, .66);
  --stroke: rgba(148, 163, 184, .24);
  --stroke-gold: rgba(200, 162, 74, .34);
  --shadow-sm: 0 10px 24px rgba(7, 20, 38, .07);
  --shadow-md: 0 22px 54px rgba(7, 20, 38, .12);
  --shadow-lg: 0 32px 90px rgba(7, 20, 38, .18);
  --glow: 0 0 0 1px rgba(255,255,255,.5), 0 18px 70px rgba(200,162,74,.18);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --container-pad: clamp(16px, 3vw, 32px);
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.public-brand {
  letter-spacing: 0;
  line-height: 1.12;
}

h1,
h2,
h3 {
  color: var(--navy-900);
  font-weight: 850;
}

p {
  color: var(--slate);
}

a {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.container,
.container-fluid {
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.app-site {
  background:
    radial-gradient(circle at 16% 8%, rgba(200,162,74,.13), transparent 28rem),
    radial-gradient(circle at 86% 4%, rgba(13,110,253,.08), transparent 24rem),
    linear-gradient(180deg, #f8fafc, #eef3f8);
}

.public-site {
  background:
    radial-gradient(circle at 12% -4%, rgba(200,162,74,.16), transparent 34rem),
    radial-gradient(circle at 92% 12%, rgba(11,31,58,.08), transparent 30rem),
    #ffffff;
}

.auth-bg {
  background:
    linear-gradient(135deg, rgba(7,20,38,.72), rgba(7,20,38,.24)),
    url("https://images.unsplash.com/photo-1604719312566-8912e9227c6a?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
}

.brand,
.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-size: 22px;
  font-weight: 900;
}

.brand::before,
.public-brand::before {
  content: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--gold-500), #f2d58a);
  color: var(--navy-950);
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(200,162,74,.28), inset 0 1px 0 rgba(255,255,255,.75);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 28px rgba(7,20,38,.12), inset 0 1px 0 rgba(255,255,255,.75);
}

.auth-home-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  color: #fff;
  text-decoration: none;
  font-size: 23px;
  font-weight: 900;
  text-shadow: 0 8px 28px rgba(0,0,0,.35);
}

.auth-home-brand:hover {
  color: #f2d58a;
}

.branding-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(200,162,74,.2);
  border-radius: var(--radius);
  background: rgba(255,255,255,.58);
}

.brand-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
}

.brand-preview img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.admin-product-thumb {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.72);
  background: rgba(255,255,255,.7);
  box-shadow: var(--shadow-sm);
}

.brand-preview span {
  color: var(--slate);
  font-size: 13px;
  font-weight: 750;
}

.public-nav {
  min-height: 76px;
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid rgba(231,226,213,.82);
  box-shadow: 0 14px 36px rgba(7,20,38,.06);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.public-nav .nav-link {
  border-radius: 999px;
  color: var(--navy-900);
  font-size: 14px;
  font-weight: 750;
  padding: 9px 13px;
}

.public-nav .nav-link:hover {
  background: rgba(200,162,74,.14);
  color: var(--navy-950);
}

.navbar-toggler {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.sidebar {
  width: 284px;
  min-width: 284px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  box-shadow: inset -1px 0 0 rgba(255,255,255,.08), 18px 0 54px rgba(7,20,38,.12);
}

.admin-sidebar {
  background:
    linear-gradient(180deg, rgba(200,162,74,.08), rgba(255,255,255,.02)),
    linear-gradient(180deg, #111827, #071426);
}

.sidebar .brand {
  width: 100%;
  padding: 8px 8px 24px;
  color: #fff;
}

.sidebar .nav {
  gap: 5px;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255,255,255,.82);
  font-size: 14px;
  font-weight: 650;
  padding: 10px 12px;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  transform: translateX(2px);
}

.sidebar .bi {
  color: var(--gold-500);
  font-size: 17px;
}

.topbar {
  min-height: 74px;
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 14px 38px rgba(7,20,38,.05);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  padding: 0 clamp(18px, 3vw, 34px);
}

.content > main {
  max-width: 1500px;
  margin: 0 auto;
}

.panel,
.stat-card:not(.member-stat-card),
.product-card,
.shop-card,
.quote-card,
.calculator,
.value-grid div,
.icon-grid div,
.public-form,
.blog-card {
  position: relative;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,255,255,.66)),
    linear-gradient(145deg, rgba(200,162,74,.08), rgba(16,43,76,.04));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.88);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.panel::after,
.shop-card::after,
.stat-card:not(.member-stat-card)::after,
.quote-card::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.34), transparent 38%);
  opacity: .65;
}

.panel > *,
.shop-card > *,
.stat-card:not(.member-stat-card) > *,
.quote-card > * {
  position: relative;
  z-index: 1;
}

.panel {
  padding: clamp(20px, 2.4vw, 30px);
}

.stat-card {
  min-height: 132px;
  padding: 22px;
  gap: 8px;
}

.stat-card strong {
  color: var(--navy-900);
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 850;
}

.stat-card span {
  color: var(--slate);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.stat-card .bi {
  color: var(--gold-500);
  font-size: 24px;
}

.btn {
  min-height: 40px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  padding: 9px 18px;
  box-shadow: none;
}

.btn-sm {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
}

.btn-lg {
  min-height: 50px;
  padding: 12px 24px;
}

.btn-primary {
  background: linear-gradient(145deg, var(--navy-900), var(--navy-800));
  border-color: rgba(16,43,76,.9);
  box-shadow: 0 14px 28px rgba(11,31,58,.18), inset 0 1px 0 rgba(255,255,255,.16);
}

.btn-primary:hover {
  background: linear-gradient(145deg, var(--navy-800), var(--navy-950));
  border-color: var(--navy-900);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(11,31,58,.24);
}

.btn-outline-primary {
  border-color: rgba(11,31,58,.28);
  color: var(--navy-900);
  background: rgba(255,255,255,.42);
}

.btn-outline-primary:hover {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(145deg, #f2d58a, var(--gold-500));
  border-color: rgba(200,162,74,.7);
  color: var(--navy-950);
  box-shadow: 0 16px 34px rgba(200,162,74,.24), inset 0 1px 0 rgba(255,255,255,.5);
}

.btn-gold:hover {
  background: linear-gradient(145deg, #f5df9d, var(--gold-600));
  color: var(--navy-950);
  transform: translateY(-1px);
}

.form-control,
.form-select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(100,116,139,.2);
  background-color: rgba(255,255,255,.82);
  color: var(--ink);
  font-size: 14.5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(200,162,74,.82);
  box-shadow: 0 0 0 .22rem rgba(200,162,74,.18);
}

.form-label {
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 800;
}

.alert {
  border: 1px solid rgba(255,255,255,.58);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.badge {
  border-radius: 999px;
  font-weight: 800;
  padding: .46em .72em;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  color: var(--ink);
}

.table thead th {
  border-bottom: 1px solid rgba(100,116,139,.18);
  color: var(--slate);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td,
.table th {
  padding: 14px 12px;
  vertical-align: middle;
}

.table tbody tr {
  border-color: rgba(100,116,139,.14);
}

.table tbody tr:hover {
  background: rgba(200,162,74,.07);
}

.hero-carousel,
.hero-slide {
  min-height: clamp(560px, 76vh, 760px);
}

.hero-slide::before,
.page-hero::before,
.category-tile::before {
  background:
    linear-gradient(90deg, rgba(7,20,38,.84), rgba(7,20,38,.42) 52%, rgba(7,20,38,.14)),
    radial-gradient(circle at 24% 46%, rgba(200,162,74,.22), transparent 26rem);
}

.hero-copy {
  max-width: 940px;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(7,20,38,.5), rgba(255,255,255,.08));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.hero-copy h1,
.page-hero h1 {
  max-width: 780px;
  font-size: clamp(40px, 6vw, 78px);
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy h1,
.page-hero h1,
.hero-copy p,
.page-hero p {
  color: #fff;
}

.hero-copy .eyebrow,
.hero-copy > p,
.page-hero p {
  color: #f2d58a;
}

.hero-copy p,
.page-hero p,
.eyebrow {
  color: #f2d58a;
  font-size: 12px;
  letter-spacing: .08em;
}

.compact-hero,
.business-hero {
  min-height: clamp(300px, 42vh, 430px);
}

.page-hero .container {
  padding-top: 48px;
  padding-bottom: 48px;
}

.public-section {
  padding: clamp(54px, 7vw, 94px) 0;
}

.section-head {
  margin-bottom: clamp(22px, 3vw, 34px);
}

.section-head h2,
.public-section h2 {
  font-size: clamp(28px, 3.1vw, 44px);
}

.soft-band {
  background:
    radial-gradient(circle at 12% 12%, rgba(200,162,74,.12), transparent 26rem),
    linear-gradient(180deg, #f8fafc, #eef3f8);
}

.dark-band {
  background:
    radial-gradient(circle at 78% 14%, rgba(200,162,74,.2), transparent 22rem),
    linear-gradient(145deg, var(--navy-900), var(--navy-950));
}

.value-grid,
.icon-grid,
.calc-output {
  gap: 18px;
}

.value-grid div,
.icon-grid div,
.quote-card {
  padding: 24px;
}

.icon-grid div:hover,
.shop-card:hover,
.category-tile:hover,
.quote-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--glow);
}

.category-tile {
  min-height: clamp(260px, 32vw, 380px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.category-tile span {
  font-size: clamp(24px, 3vw, 38px);
  text-shadow: 0 8px 30px rgba(0,0,0,.32);
}

.shop-card {
  border-radius: var(--radius-lg);
}

.shop-card img {
  aspect-ratio: 4 / 5;
  transform: scale(1.001);
  transition: transform .35s ease;
}

.shop-card:hover img {
  transform: scale(1.035);
}

.shop-card-body {
  padding: 20px;
}

.shop-card h3 {
  color: var(--navy-900);
  font-size: 18px;
  font-weight: 850;
}

.shop-filter {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: var(--radius-lg);
  background: var(--glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.product-gallery .zoom-image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.gallery-thumbs img {
  border: 2px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.gallery-thumbs img:hover {
  border-color: var(--gold-500);
}

.payment-box,
.map-placeholder {
  border: 1px solid var(--stroke-gold);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255,255,255,.78), rgba(247,239,217,.76)),
    radial-gradient(circle at 22% 20%, rgba(200,162,74,.18), transparent 14rem);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), var(--shadow-sm);
}

.matrix-visual span {
  background:
    linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.02)),
    linear-gradient(145deg, var(--navy-900), var(--navy-950));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 40px rgba(7,20,38,.2), inset 0 1px 0 rgba(255,255,255,.18);
}

.calc-output div {
  background:
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(246,248,251,.78));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}

.tree-node {
  border-color: rgba(255,255,255,.68);
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-sm);
}

.tree-toggle {
  background: linear-gradient(145deg, var(--gold-500), #f2d58a);
  color: var(--navy-950);
  font-weight: 900;
}

.public-footer {
  background:
    radial-gradient(circle at 18% 0%, rgba(200,162,74,.18), transparent 24rem),
    linear-gradient(145deg, var(--navy-950), #030912);
  border-top: 1px solid rgba(255,255,255,.08);
}

.public-footer h2,
.public-footer h3 {
  color: #fff;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-brand .brand-logo,
.footer-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.public-footer p {
  color: rgba(255,255,255,.76);
}

.public-footer a {
  color: rgba(255,255,255,.9);
  font-weight: 650;
}

.public-footer a:hover {
  color: #f2d58a;
  transform: translateX(2px);
}

.public-footer .form-control {
  background: rgba(255,255,255,.94);
  border-color: rgba(255,255,255,.36);
  color: var(--navy-950);
}

.public-footer .form-control::placeholder {
  color: rgba(7,20,38,.62);
}

.product-media,
.product-hero {
  background:
    radial-gradient(circle at 30% 18%, rgba(200,162,74,.18), transparent 18rem),
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(238,243,248,.9));
  color: var(--gold-500);
}

.product-hero,
.product-media {
  border-radius: var(--radius);
}

@media (max-width: 992px) {
  .public-nav {
    min-height: 68px;
  }

  .public-nav .navbar-collapse {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius);
    background: rgba(255,255,255,.88);
    box-shadow: var(--shadow-sm);
  }

  .hero-copy {
    padding: 24px;
  }

  .detail-actions,
  .cart-summary {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    width: min(88vw, 300px);
    min-width: 0;
    border-radius: 0;
  }

  .sidebar .brand {
    padding-bottom: 14px;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 15px;
  }

  .hero-carousel,
  .hero-slide {
    min-height: 560px;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: 38px;
  }

  .hero-copy {
    padding: 20px;
    border-radius: var(--radius);
  }

  .public-section {
    padding: 46px 0;
  }

  .panel,
  .stat-card {
    padding: 18px;
  }

  .table td,
  .table th {
    padding: 12px 10px;
  }

  .branding-upload-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin placement queue */
.placement-queue-wrap {
  margin-bottom: 0;
}

.placement-panel {
  height: 100%;
}

.placement-queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.placement-queue-item {
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.placement-queue-item.is-immediate {
  border-color: rgba(25, 135, 84, 0.35);
  background: rgba(25, 135, 84, 0.06);
  box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.08);
}

.placement-queue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.placement-queue-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.placement-queue-desc strong {
  color: #0f172a;
}

.placement-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.placement-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px dashed rgba(15, 23, 42, 0.18);
  color: rgba(15, 23, 42, 0.45);
  font-size: 0.82rem;
  font-weight: 700;
  background: #fff;
}

.placement-slot.is-filled {
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.placement-slot.is-next {
  border-color: #198754;
  background: rgba(25, 135, 84, 0.12);
  color: #146c43;
  animation: placement-pulse 1.6s ease-in-out infinite;
}

.placement-root-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  font-size: 0.82rem;
  font-weight: 600;
}

.placement-hint {
  font-weight: 600;
  white-space: nowrap;
}

.placement-queue-compact .placement-queue-item {
  padding: 12px 14px;
}

@keyframes placement-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.25); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(25, 135, 84, 0); }
}

/* Admin dashboard premium stat cards */
.admin-stat-grid {
  --admin-stat-radius: 18px;
}

.admin-site .admin-stat-card {
  min-height: 148px;
  padding: 22px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--admin-stat-radius);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.admin-site .admin-stat-card::after {
  opacity: 0.35;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.42), transparent 42%);
}

.admin-site .admin-stat-card__icon {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1;
  font-size: 2.6rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.admin-site .admin-stat-card__label {
  position: relative;
  z-index: 2;
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-site .admin-stat-card__value {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 850;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
}

.admin-site .admin-stat-card--indigo {
  background: linear-gradient(135deg, #3730a3 0%, #6366f1 52%, #818cf8 100%);
}

.admin-site .admin-stat-card--emerald {
  background: linear-gradient(135deg, #047857 0%, #10b981 55%, #34d399 100%);
}

.admin-site .admin-stat-card--slate {
  background: linear-gradient(135deg, #334155 0%, #64748b 55%, #94a3b8 100%);
}

.admin-site .admin-stat-card--gold {
  background: linear-gradient(135deg, #b45309 0%, #d97706 48%, #fbbf24 100%);
}

.admin-site .admin-stat-card--teal {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #2dd4bf 100%);
}

.admin-site .admin-stat-card--blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 52%, #60a5fa 100%);
}

.admin-site .admin-stat-card--rose {
  background: linear-gradient(135deg, #be185d 0%, #db2777 52%, #f472b6 100%);
}

.admin-site .admin-stat-card--amber {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #fb923c 100%);
}

.admin-site .admin-stat-card--violet {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 52%, #a78bfa 100%);
}

.admin-site .admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 22px 44px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@media (max-width: 767.98px) {
  .admin-site .admin-stat-card {
    min-height: 132px;
    padding: 18px;
  }

  .admin-site .admin-stat-card__icon {
    font-size: 2.1rem;
    top: 12px;
    right: 12px;
  }
}

/* Member dashboard premium stat cards */
.member-stat-grid {
  --member-stat-radius: 18px;
}

.member-site .member-stat-card {
  position: relative;
  min-height: 148px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--member-stat-radius);
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.member-site .member-stat-card::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.42), transparent 42%);
  opacity: 0.35;
  z-index: 0;
}

.member-site .member-stat-card__icon {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1;
  font-size: 2.6rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.22) !important;
  pointer-events: none;
}

.member-site .member-stat-card__label {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-site .member-stat-card__value {
  position: relative;
  z-index: 2;
  display: block;
  color: #fff !important;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem) !important;
  font-weight: 850 !important;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
}

.member-site .member-stat-card--indigo {
  background: linear-gradient(135deg, #3730a3 0%, #6366f1 52%, #818cf8 100%) !important;
}

.member-site .member-stat-card--emerald {
  background: linear-gradient(135deg, #047857 0%, #10b981 55%, #34d399 100%) !important;
}

.member-site .member-stat-card--gold {
  background: linear-gradient(135deg, #b45309 0%, #d97706 48%, #fbbf24 100%) !important;
}

.member-site .member-stat-card--blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 52%, #60a5fa 100%) !important;
}

.member-site .member-stat-card--rose {
  background: linear-gradient(135deg, #be185d 0%, #db2777 52%, #f472b6 100%) !important;
}

.member-site .member-stat-card--amber {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #fb923c 100%) !important;
}

.member-site .member-stat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 22px 44px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

@media (max-width: 767.98px) {
  .member-site .member-stat-card {
    min-height: 120px;
    padding: 16px;
  }

  .member-site .member-stat-card__icon {
    font-size: 2rem;
    top: 10px;
    right: 10px;
  }

  .member-site .member-stat-card__label {
    font-size: 0.68rem !important;
    margin-bottom: 6px;
  }

  .member-site .member-stat-card__value {
    font-size: clamp(1.25rem, 5vw, 1.65rem) !important;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .member-stat-grid .member-stat-card {
    min-height: 136px;
  }
}

@media (min-width: 1400px) {
  .member-stat-grid {
    --member-stat-radius: 20px;
  }

  .member-site .member-stat-card {
    min-height: 156px;
  }
}

.payment-details-box {
  display: grid;
  gap: 16px;
}

.payment-qr-wrap {
  text-align: center;
}

.payment-qr-image {
  max-width: 220px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 8px;
}

.payment-bank-details pre {
  white-space: pre-wrap;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 10px;
  padding: 12px;
}

.product-media img,
.product-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 210px;
}

.member-credentials-box {
  border: 1px solid rgba(25, 135, 84, 0.25);
  background: rgba(25, 135, 84, 0.05);
}

.admin-tree-view .tree-node {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  margin-bottom: 6px;
}

.admin-tree-view .root-tree,
.admin-tree-view ul {
  list-style: none;
  padding-left: 18px;
}

.matrix-rebuild-panel {
  max-width: 360px;
  padding: 16px 18px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(254, 243, 199, 0.35);
}

.matrix-rebuild-panel h2 {
  color: #92400e;
}

.data-reset-panel {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(254, 242, 242, 0.55);
}

.admin-pagination {
  margin: 0;
}

/* Corporate org-chart tree */
.corp-tree-page {
  --corp-navy: #0b1f3a;
  --corp-navy-soft: #102b4c;
  --corp-gold: #c8a24a;
  --corp-gold-light: #f7efd9;
  --corp-line: rgba(16, 43, 76, 0.14);
  --corp-shadow: 0 14px 40px rgba(7, 20, 38, 0.08);
}

.corp-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 24px 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--corp-navy) 0%, var(--corp-navy-soft) 55%, #16365f 100%);
  color: #fff;
  box-shadow: var(--corp-shadow);
  position: relative;
  overflow: hidden;
}

.corp-tree-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(200, 162, 74, 0.12) 100%);
  pointer-events: none;
}

.corp-tree-header__main {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.corp-tree-header__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1.45rem;
  color: var(--corp-gold);
}

.corp-tree-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.corp-tree-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 850;
  letter-spacing: -0.02em;
}

.corp-tree-subtitle {
  margin: 0;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.55;
}

.corp-tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.corp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.corp-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.corp-legend-dot.is-active { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25); }
.corp-legend-dot.is-pending { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25); }

.corp-legend-line {
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--corp-gold), rgba(255, 255, 255, 0.5));
  display: inline-block;
  border-radius: 2px;
}

.corp-legend-chip {
  font-style: normal;
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: rgba(200, 162, 74, 0.22);
  color: var(--corp-gold-light);
  font-size: 0.72rem;
  font-weight: 800;
}

.corp-tree-canvas {
  padding: clamp(20px, 3vw, 36px);
  overflow-x: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 162, 74, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 251, 0.92));
  border: 1px solid rgba(16, 43, 76, 0.08);
}

.corp-tree.corp-tree,
.corp-tree-root {
  min-width: min(100%, 720px);
}

.corp-tree-root {
  display: flex;
  justify-content: center;
  padding: 8px 0 20px;
}

.corp-tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.corp-tree-card {
  position: relative;
  width: min(100%, 280px);
  background: #fff;
  border: 1px solid var(--corp-line);
  border-radius: 16px;
  box-shadow: var(--corp-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.corp-tree-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(7, 20, 38, 0.12);
}

.corp-tree-card__stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--corp-navy), var(--corp-gold));
}

.corp-tree-card.is-pending .corp-tree-card__stripe {
  background: linear-gradient(90deg, #64748b, #fbbf24);
}

.corp-tree-card__content {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 16px 14px;
}

.corp-tree-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  color: var(--corp-navy);
  background: linear-gradient(145deg, var(--corp-gold-light), #fff);
  border: 1px solid rgba(200, 162, 74, 0.35);
}

.corp-tree-card.is-pending .corp-tree-avatar {
  background: linear-gradient(145deg, #f1f5f9, #fff);
  border-color: rgba(100, 116, 139, 0.25);
  color: #64748b;
}

.corp-tree-details {
  min-width: 0;
  flex: 1;
}

.corp-tree-id {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 850;
  color: var(--corp-navy);
  letter-spacing: 0.02em;
}

.corp-tree-name {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--slate, #5d6b82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.corp-tree-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.corp-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(16, 43, 76, 0.06);
  color: var(--corp-navy-soft);
}

.corp-tag--level { background: rgba(16, 43, 76, 0.08); }
.corp-tag--pos { background: rgba(200, 162, 74, 0.14); color: #8a6920; }
.corp-tag--team { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }
.corp-tag--status.is-active { background: rgba(16, 185, 129, 0.12); color: #047857; }
.corp-tag--status.is-pending { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.corp-tree-expand {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--corp-gold), #f2d58a);
  color: var(--corp-navy);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(200, 162, 74, 0.35);
}

.corp-tree-branch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.corp-tree-branch-wrap.is-collapsed {
  display: none;
}

.corp-tree-connector-down {
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, var(--corp-gold), var(--corp-line));
}

.corp-tree-children {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 22px);
  flex-wrap: wrap;
  position: relative;
  padding-top: 28px;
  max-width: 100%;
}

.corp-tree-children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--corp-line), var(--corp-gold), var(--corp-line), transparent);
}

.corp-tree-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 200px;
}

.corp-tree-branch::before {
  content: "";
  width: 2px;
  height: 28px;
  background: var(--corp-line);
  display: block;
}

.corp-tree-node.is-root > .corp-tree-card {
  border-color: rgba(200, 162, 74, 0.35);
  box-shadow: 0 20px 50px rgba(7, 20, 38, 0.12);
}

.corp-tree-loading,
.corp-tree-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  text-align: center;
  color: var(--slate, #5d6b82);
}

.corp-tree-empty i {
  font-size: 2.2rem;
  color: var(--corp-gold);
}

.corp-tree-empty h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--corp-navy);
}

.corp-tree-empty p {
  margin: 0;
  max-width: 36ch;
  font-size: 0.9rem;
}

.corp-tree-empty.is-error i {
  color: #dc2626;
}

.corp-tree-loading__spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(16, 43, 76, 0.1);
  border-top-color: var(--corp-gold);
  animation: corp-spin 0.8s linear infinite;
}

@keyframes corp-spin {
  to { transform: rotate(360deg); }
}

/* Matrix pyramid (5-wide levels: 1 → 5 → 25) */
.matrix-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 12px 8px 24px;
  overflow-x: auto;
}

.matrix-pyramid-row {
  display: grid;
  grid-template-columns: 120px 24px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: min(100%, 960px);
}

.matrix-pyramid-row__label {
  justify-self: end;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.matrix-pyramid-row.is-depth-0 .matrix-pyramid-row__label { background: #16a34a; }
.matrix-pyramid-row.is-depth-1 .matrix-pyramid-row__label { background: #2563eb; }
.matrix-pyramid-row.is-depth-2 .matrix-pyramid-row__label { background: #ea580c; }
.matrix-pyramid-row.is-depth-3 .matrix-pyramid-row__label { background: #7c3aed; }

.matrix-pyramid-row__connector {
  width: 2px;
  min-height: 48px;
  background: linear-gradient(180deg, rgba(16, 43, 76, 0.15), rgba(16, 43, 76, 0.35));
  justify-self: center;
}

.matrix-pyramid-row__slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.matrix-pyramid-row.is-depth-0 .matrix-pyramid-row__slots {
  justify-content: center;
}

.matrix-pyramid-row.is-depth-2 .matrix-pyramid-row__slots {
  max-width: 100%;
}

.matrix-pyramid-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 88px;
  max-width: 110px;
}

.matrix-pyramid-slot__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--corp-navy, #102b4c);
  opacity: 0.85;
}

.matrix-pyramid-slot__card {
  position: relative;
  width: 100%;
  min-height: 92px;
  padding: 10px 8px 8px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 43, 76, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.matrix-pyramid-row.is-depth-2 .matrix-pyramid-slot__card {
  border-radius: 18px;
  min-height: 78px;
}

.matrix-pyramid-slot.is-empty .matrix-pyramid-slot__card {
  border: 2px dashed rgba(16, 43, 76, 0.22);
  background: rgba(248, 250, 252, 0.9);
  color: rgba(16, 43, 76, 0.45);
  font-size: 0.75rem;
}

.matrix-pyramid-slot.is-depth-0 .matrix-pyramid-slot__card {
  border-color: #16a34a;
  background: linear-gradient(160deg, #22c55e, #15803d);
  color: #fff;
  min-width: 110px;
  min-height: 110px;
}

.matrix-pyramid-slot.is-depth-1:not(.is-empty) .matrix-pyramid-slot__card {
  border-color: #2563eb;
  background: linear-gradient(160deg, #3b82f6, #1d4ed8);
  color: #fff;
}

.matrix-pyramid-slot.is-depth-2:not(.is-empty) .matrix-pyramid-slot__card {
  border-color: #ea580c;
  background: linear-gradient(160deg, #fb923c, #c2410c);
  color: #fff;
}

.matrix-pyramid-slot.is-viewer .matrix-pyramid-slot__card {
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.85), 0 6px 18px rgba(16, 43, 76, 0.15);
}

.matrix-pyramid-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.matrix-pyramid-you {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #facc15;
  color: #102b4c;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}

.matrix-pyramid-id {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.matrix-pyramid-name {
  font-size: 0.65rem;
  opacity: 0.92;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .corp-tree-header {
    padding: 16px;
    gap: 16px;
  }

  .corp-tree-header__main {
    flex-direction: column;
    gap: 12px;
  }

  .corp-tree-title {
    font-size: 1.25rem;
  }

  .corp-tree-subtitle {
    font-size: 0.88rem;
  }

  .corp-tree-legend {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .corp-tree-canvas {
    padding: 12px;
    border-radius: 14px;
  }

  .corp-tree-card {
    width: min(100%, 260px);
  }

  .corp-tree-children {
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
  }

  .corp-tree-children::before,
  .corp-tree-branch::before {
    display: none;
  }

  .matrix-pyramid {
    gap: 20px;
    padding: 8px 0 16px;
    align-items: stretch;
  }

  .matrix-pyramid-row {
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
  }

  .matrix-pyramid-row__connector {
    display: none;
  }

  .matrix-pyramid-row__label {
    justify-self: start;
    font-size: 0.72rem;
    padding: 6px 10px;
  }

  .matrix-pyramid-row__slots {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 8px;
    padding: 2px 2px 10px;
    width: 100%;
  }

  .matrix-pyramid-row__slots::-webkit-scrollbar {
    height: 6px;
  }

  .matrix-pyramid-row__slots::-webkit-scrollbar-thumb {
    background: rgba(16, 43, 76, 0.22);
    border-radius: 999px;
  }

  .matrix-pyramid-slot {
    scroll-snap-align: start;
    flex: 0 0 auto;
    min-width: 70px;
    max-width: 82px;
  }

  .matrix-pyramid-slot__card {
    min-height: 76px;
    padding: 8px 6px 6px;
  }

  .matrix-pyramid-slot.is-depth-0 .matrix-pyramid-slot__card {
    min-width: 92px;
    min-height: 92px;
  }

  .matrix-pyramid-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }

  .matrix-pyramid-id {
    font-size: 0.65rem;
  }

  .matrix-pyramid-name {
    font-size: 0.58rem;
  }

  .matrix-pyramid-row.is-depth-1,
  .matrix-pyramid-row.is-depth-2 {
    padding-bottom: 22px;
  }

  .matrix-pyramid-row.is-depth-1::after,
  .matrix-pyramid-row.is-depth-2::after {
    content: "Swipe slots horizontally →";
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(16, 43, 76, 0.45);
    text-align: center;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .matrix-pyramid-row {
    grid-template-columns: 100px 20px 1fr;
    min-width: 0;
  }

  .matrix-pyramid-slot {
    min-width: 80px;
    max-width: 100px;
  }

  .corp-tree-header {
    padding: 20px;
  }
}

@media (min-width: 1200px) {
  .matrix-pyramid {
    max-width: 1280px;
    margin-inline: auto;
  }

  .matrix-pyramid-row.is-depth-2 .matrix-pyramid-row__slots {
    gap: 12px;
  }
}

@media (min-width: 1400px) {
  .matrix-pyramid {
    max-width: 1400px;
  }

  .matrix-pyramid-slot {
    min-width: 96px;
    max-width: 118px;
  }

  .admin-stat-grid .admin-stat-card {
    min-height: 148px;
  }
}
