:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --slate-dark: #0F172A;
  --slate-mid: #1E293B;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --amber: #D97706;
  --gold: #E8CFA0;
  --green: #16A34A;
  --red: #DC2626;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
.topbar { background: var(--slate-dark); color: #F8FAFC; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #334155; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.topbar .sub { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.card-5d { background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #cbd5e1; border-radius: 12px; padding: 18px; box-shadow: 0 12px 24px -12px rgba(15,23,42,0.18), inset 0 1px 0 rgba(255,255,255,0.9); transition: transform .22s ease, box-shadow .22s ease; }
.card-5d:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -12px rgba(15,23,42,0.28); border-color: #94a3b8; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.kpi-val { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.tab-btn { padding: 8px 14px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.tab-btn.active { background: var(--slate-dark); color: var(--gold); border-color: var(--slate-dark); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: #F1F5F9; }
.num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #CBD5E1; border-radius: 8px; font-size: 13px; background: #fff; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: #334155; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: 12.5px; font-weight: 700; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-dark { background: var(--slate-dark); color: var(--gold); }
.btn-gold { background: var(--gold); color: var(--slate-dark); }
.btn-outline { background: #fff; border-color: #CBD5E1; color: var(--text); }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.status-ok { color: var(--green); font-weight: 700; }
.status-warn { color: var(--amber); font-weight: 700; }
.status-err { color: var(--red); font-weight: 700; }
.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.alert-ok { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.alert-err { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* === 5D SHOWCASE HERO & FILTER TOOLBAR === */
.hero-5d {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 65%, #1A140B 100%);
  color: #F8FAFC;
  border-radius: 16px;
  padding: 26px 24px;
  margin-bottom: 20px;
  border: 1px solid #334155;
  box-shadow: 0 20px 36px -22px rgba(15, 23, 42, 0.55);
}
.hero-5d .eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #E8CFA0;
  font-weight: 700;
  margin: 0 0 6px 0;
}
.hero-5d h2 {
  margin: 0 0 8px 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  line-height: 1.25;
  color: #FFFFFF;
}
.hero-5d p.lead {
  margin: 0;
  font-size: 13.5px;
  color: #CBD5E1;
  max-width: 780px;
  line-height: 1.55;
}
.toolbar-5d {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.search-5d {
  max-width: 280px;
  min-width: 200px;
}

/* === 5D SHOWCASE GRID === */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}
.showcase-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  padding: 20px;
  display: grid;
  grid-template-columns: 196px 1fr;
  gap: 20px;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.28);
}
.showcase-card:hover {
  border-color: #94A3B8;
  box-shadow: 0 18px 32px -18px rgba(15, 23, 42, 0.35);
}
@media (max-width: 640px) {
  .showcase-card {
    grid-template-columns: 1fr;
  }
}

/* === TRUE 5D SPATIAL HARDCOVER & SOFTWARE BOX === */
.stage-5d-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stage-5d {
  position: relative;
  width: 176px;
  height: 246px;
  perspective: 1400px;
  cursor: pointer;
  user-select: none;
}
.shadow-5d {
  position: absolute;
  bottom: -12px;
  left: 14px;
  right: 14px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.38);
  filter: blur(8px);
  pointer-events: none;
}
.volume-5d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  transform: rotateX(4deg) rotateY(-19deg);
}
.face-front-5d, .face-back-5d {
  position: absolute;
  inset: 0;
  border-radius: 2px 9px 9px 2px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  color: #FAF9F6;
  border: 1px solid rgba(232, 207, 160, 0.42);
  box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.56);
}
.face-front-5d {
  transform: translateZ(14px);
}
.face-back-5d {
  transform: rotateY(180deg) translateZ(14px);
  background: #161412;
  border-radius: 9px 2px 2px 9px;
}
.face-front-5d img.cover-img-5d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}
.cover-scrim-5d {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.82) 0%, rgba(10,10,10,0.28) 45%, rgba(10,10,10,0.92) 100%);
}
.sheen-5d {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 22%, rgba(245, 208, 138, 0.24) 48%, transparent 74%);
}
.face-spine-5d {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28px;
  transform: rotateY(-90deg) translateZ(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(232, 207, 160, 0.35);
  box-shadow: inset -3px 0 8px rgba(0, 0, 0, 0.55);
}
.face-spine-5d span {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #E8CFA0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
.face-pages-5d {
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: 0;
  width: 28px;
  transform: rotateY(90deg) translateZ(14px);
  background: repeating-linear-gradient(to right, #f5f0e4 0px, #f5f0e4 1.5px, #ddd4c2 2px, #e8e0cf 3px);
  box-shadow: inset 4px 0 8px rgba(0, 0, 0, 0.2);
}
.cover-z-top {
  position: relative;
  z-index: 2;
  text-align: center;
}
.cover-z-top .author-5d {
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #E8CFA0;
  font-weight: 700;
}
.cover-z-top .rule-5d {
  width: 30px;
  height: 1px;
  background: rgba(232, 207, 160, 0.75);
  margin: 7px auto;
}
.cover-z-top h4 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 6px rgba(0,0,0,0.65);
}
.badge-z-5d {
  position: relative;
  z-index: 3;
  margin: 0 auto;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(232, 207, 160, 0.52);
  background: rgba(12, 10, 9, 0.78);
  text-align: center;
  transform: translateZ(32px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.45);
}
.badge-z-5d strong {
  display: block;
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #F5D08A;
}
.badge-z-5d small {
  display: block;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E7E5E4;
  margin-top: 2px;
}
.cover-z-bot {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 9.5px;
  color: #F5D08A;
  line-height: 1.3;
}
.btn-flip-5d {
  margin-top: 14px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  background: #F1F5F9;
  color: #1E293B;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  cursor: pointer;
}
.btn-flip-5d:hover {
  background: #FEF3C7;
  border-color: #D97706;
}

/* === ANDROID PHONE UI SCREENSHOT MOCKUP (FOR 40 APPS 5D) === */
.app-visual-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
}
.phone-5d {
  width: 176px;
  background: #0F172A;
  border: 4px solid #334155;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 28px -14px rgba(15, 23, 42, 0.45);
  font-size: 10px;
}
.phone-5d.phone-large {
  width: 280px;
  font-size: 12px;
}
.phone-topbar {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  background: #020617;
  color: #94A3B8;
  font-size: 8.5px;
  font-weight: 700;
}
.phone-header {
  padding: 9px 10px;
  color: #FFFFFF;
}
.phone-header .ph-sub {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #E8CFA0;
  font-weight: 700;
}
.phone-header .ph-title {
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.phone-screen-body {
  background: #F8FAFC;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.phone-kpi {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 7px 8px;
}
.phone-kpi .pk-l {
  font-size: 8px;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 700;
}
.phone-kpi .pk-v {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
}
.phone-kpi .pk-s {
  font-size: 8.5px;
  color: #16A34A;
  font-weight: 600;
}
.phone-row {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 5px 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.phone-row .pr-l {
  font-weight: 600;
  color: #1E293B;
  font-size: 9px;
}
.phone-row .pr-v {
  font-weight: 700;
  color: #0F172A;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phone-cta {
  text-align: center;
  padding: 6px;
  border-radius: 7px;
  background: #0F172A;
  color: #E8CFA0;
  font-weight: 700;
  font-size: 9px;
}

/* === MODAL 5D READER & ANDROID SCREENSHOT PREVIEW === */
.modal-backdrop-5d {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-panel-5d {
  background: #FAF6ED;
  color: #1C1917;
  border: 1px solid #D6D3D1;
  border-radius: 16px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}
.book-chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px 0;
}
.chap-pill {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
}
.chap-pill.active {
  background: #0F172A;
  color: #E8CFA0;
  border-color: #0F172A;
}
.book-page-paper {
  background: #FFFDF8;
  border: 1px solid #E7E5E4;
  border-radius: 10px;
  padding: 24px;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.8;
  color: #1C1917;
}

/* === SIDEBAR SHELL FOR MASTER / ADMIN / MITRA PORTALS === */
.sun3-shell {
  display: flex;
  min-height: 100vh;
  background: #F8FAFC;
}
.sun3-sidebar {
  width: 268px;
  flex-shrink: 0;
  background: #0F172A;
  color: #E2E8F0;
  border-right: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sun3-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px 8px;
  border-bottom: 1px solid #1E293B;
  margin-bottom: 14px;
}
.sun3-brand img.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(232, 207, 160, 0.45);
  background: #1E293B;
}
.sun3-brand .brand-kicker {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E8CFA0;
  font-weight: 700;
}
.sun3-brand .brand-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 185px;
}
.sun3-nav-group {
  margin-bottom: 10px;
}
.sun3-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #CBD5E1;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.sun3-nav-btn:hover {
  background: #1E293B;
  color: #FFFFFF;
}
.sun3-nav-btn.active {
  background: #E8CFA0;
  color: #0F172A;
  font-weight: 700;
}
.sun3-submenu {
  margin: 4px 0 6px 12px;
  padding-left: 10px;
  border-left: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sun3-subbtn {
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.sun3-subbtn:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.06);
}
.sun3-subbtn.active {
  color: #E8CFA0;
  background: rgba(232,207,160,0.12);
}
.sun3-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sun3-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.sun3-content {
  padding: 22px;
  max-width: 1220px;
  width: 100%;
}
.sun3-mobile-toggle {
  display: none;
  padding: 7px 11px;
  border-radius: 7px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 900px) {
  .sun3-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .sun3-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 80;
    transition: left 0.22s ease;
  }
  .sun3-sidebar.open {
    left: 0;
  }
}
.bonus-tag-clean {
  font-size: 10.5px;
  font-weight: 700;
  color: #B45309;
  letter-spacing: 0.04em;
}
.promo-box-5d {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #F8FAFC;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #334155;
  margin-top: 14px;
}
.promo-box-5d h4 {
  margin: 0 0 6px 0;
  color: #E8CFA0;
  font-family: Georgia, serif;
  font-size: 17px;
}
.action-row-5d {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.btn-xs-5d {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  cursor: pointer;
}
.btn-xs-5d:hover {
  background: #FEF3C7;
  border-color: #D97706;
}

.hidden { display: none !important; }
