:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f5f8;
  color: #172033;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f3f5f8; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(100% - 48px, 1120px);
  min-height: 100vh;
  margin: auto;
  display: grid;
  place-items: center;
  padding: 48px 0;
}

.auth-layout {
  width: 100%;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(460px, 1.1fr);
  overflow: hidden;
  border: 1px solid #e1e6ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 55px rgb(33 48 76 / 10%);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 42px;
  color: #eff5ff;
  background: #14233a;
  overflow: hidden;
}
.brand-panel::after {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  right: -190px;
  bottom: -210px;
  border: 70px solid rgb(111 174 255 / 13%);
  border-radius: 50%;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: #e8f1ff;
}
.brand-mark span {
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid #2866bd;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #e8f1ff, 0 0 0 5px #2866bd;
}
.brand-mark.compact { width: 32px; height: 32px; margin: 0 10px 0 0; }
.brand-name { color: #ecf4ff; font-size: 15px; font-weight: 800; letter-spacing: .11em; }
.brand-name span { margin-left: 5px; color: #8abaff; font-size: 10px; letter-spacing: .16em; }

.brand-copy { position: relative; z-index: 1; margin: auto 0 30px; }
.section-label { margin: 0; color: #6381ae; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.brand-copy .section-label { color: #8abaff; }
.brand-copy h1 { max-width: 330px; margin: 14px 0; color: #fff; font-size: clamp(28px, 3.1vw, 40px); letter-spacing: -.045em; line-height: 1.1; }
.brand-copy p:not(.section-label) { max-width: 300px; margin: 0; color: #b9c7da; line-height: 1.6; }
.security-list { position: relative; z-index: 1; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; color: #cbd8e9; font-size: 13px; }
.check { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 9px; border-radius: 50%; background: rgb(117 180 255 / 16%); color: #91c0ff; font-size: 11px; font-weight: 800; }
.brand-foot { position: relative; z-index: 1; margin: 30px 0 0; color: #7890ad; font-size: 11px; }

.auth-content { display: flex; flex-direction: column; justify-content: center; padding: 56px 62px; }
.auth-topline, .dashboard-header, .panel-heading { display: flex; justify-content: space-between; align-items: center; }
.secure-badge { display: inline-flex; align-items: center; gap: 7px; color: #55708f; font-size: 11px; font-weight: 650; }
.secure-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31ae70;
  box-shadow: 0 0 0 3px #e1f5e9;
  animation: connection-pulse 1.8s ease-out infinite;
}

@keyframes connection-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #e1f5e9, 0 0 0 0 rgb(49 174 112 / 34%); }
  55% { box-shadow: 0 0 0 3px #e1f5e9, 0 0 0 8px rgb(49 174 112 / 0%); }
}
.auth-heading { margin: 26px 0 30px; }
.auth-heading h2 { margin: 0 0 8px; font-size: 29px; letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: #6b7a90; line-height: 1.5; }
.form-fields { display: grid; gap: 19px; }
label { display: grid; gap: 8px; color: #344158; font-size: 12px; font-weight: 750; }
label span { display: flex; justify-content: space-between; }
label em { color: #91a0b5; font-size: 10px; font-style: normal; font-weight: 600; }
input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #d8e0eb; border-radius: 8px; outline: 0; background: #fff; color: #172033; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #a1adbd; }
input:focus { border-color: #3779d5; box-shadow: 0 0 0 3px rgb(55 121 213 / 12%); }
.actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-top: 29px; }
button { min-height: 46px; border: 1px solid transparent; border-radius: 8px; background: #2464bd; color: #fff; font-weight: 750; transition: background .15s, border-color .15s, transform .15s; }
button:hover { background: #1c559f; }
button:focus-visible { outline: 3px solid rgb(36 100 189 / 25%); outline-offset: 2px; }
button:active { transform: translateY(1px); }
button span { margin-left: 7px; }
button.secondary { border-color: #d5deea; background: #fff; color: #32445e; }
button.secondary:hover { border-color: #94a8c3; background: #f8fafc; }
.auth-note { display: flex; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf0f5; color: #748298; font-size: 11px; line-height: 1.55; }
.auth-note p { margin: 0; }
.lock { color: #3978ca; font-size: 17px; line-height: .9; }
.preview-link { width: fit-content; margin-top: 14px; color: #3970b4; font-size: 12px; font-weight: 750; text-decoration: none; }
.preview-link:hover { color: #1d569d; text-decoration: underline; }
.preview-link span { margin-left: 4px; }
.status { min-height: 18px; margin: 14px 0 0; color: #55708f; font-size: 12px; }
.status.error { color: #bd3f45; }

.dashboard { width: 100%; padding: 36px; border: 1px solid #e1e6ef; border-radius: 20px; background: #fff; box-shadow: 0 18px 55px rgb(33 48 76 / 10%); }
.dashboard.preview-shell { width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.hidden { display: none !important; }
body.authenticated .app-shell { width: 100%; max-width: none; padding: 0; display: block; }
.dashboard-header { gap: 20px; padding-bottom: 28px; border-bottom: 1px solid #e9edf3; }
.dashboard-brand { display: flex; align-items: center; margin-right: auto; }
.dashboard-brand { text-decoration: none; }
.dashboard-brand .brand-name { color: #20344f; }
.dashboard-header h1 { margin: 7px 0 0; color: #172033; font-size: 23px; letter-spacing: -.03em; }
.dashboard-header > div:nth-child(2) { margin-right: auto; }
.dashboard-actions { display: flex; align-items: center; gap: 16px; }
.nav-link, .page-nav a { color: #516982; font-size: 12px; font-weight: 750; text-decoration: none; }
.nav-link:hover, .page-nav a:hover, .page-nav a.active { color: #2464bd; }
.dashboard-header button { min-height: 38px; padding: 0 15px; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 26px 0; }
.stats div { min-height: 112px; padding: 18px; border: 1px solid #e6ebf2; border-radius: 10px; background: #fbfcfe; }
.stats .token-stat { border-color: #c8dbf7; background: #f4f8ff; }
dt { color: #77869b; font-size: 11px; font-weight: 700; }
dd { margin: 12px 0 0; color: #253954; font-size: 21px; font-weight: 780; letter-spacing: -.025em; overflow-wrap: anywhere; }
.activity-panel { margin-top: 32px; border: 1px solid #e6ebf2; border-radius: 10px; overflow: hidden; }
.panel-heading { padding: 19px 20px; border-bottom: 1px solid #e9edf3; }
.panel-heading h2 { margin: 5px 0 0; font-size: 15px; }
.panel-heading > span { color: #8795a9; font-size: 11px; }
.activity { margin: 0; padding: 0 20px; list-style: none; }
.activity:empty::after { content: "Belum ada aktivitas token."; display: block; padding: 22px 0; color: #7d8b9e; font-size: 13px; }
.activity li { padding: 14px 0; border-top: 1px solid #eef1f5; color: #52637a; font-size: 13px; }
.activity li:first-child { border-top: 0; }
.feature-panel { margin-top: 32px; border: 1px solid #e6ebf2; border-radius: 10px; overflow: hidden; background: #fff; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: #e8edf3; }
.feature-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; min-height: 110px; padding: 17px; border: 0; border-radius: 0; background: #fff; color: #2c405b; text-align: left; }
.feature-card:hover { background: #f7faff; }
.feature-card:disabled { cursor: not-allowed; opacity: .52; }
.feature-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #edf5ff; color: #3675c5; font-size: 10px; font-weight: 850; letter-spacing: .02em; }
.feature-info { display: grid; align-content: start; gap: 5px; min-width: 0; }
.feature-info b { color: #2c405b; font-size: 11px; letter-spacing: .02em; }
.feature-info small { color: #8290a3; font-size: 10px; font-weight: 500; line-height: 1.4; }
.feature-meta { grid-column: 2; color: #478060; font-size: 10px; font-weight: 800; }
.feature-meta.maintenance { color: #ba7a36; }
.feature-dialog { width: min(100% - 32px, 600px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 80px rgb(16 31 55 / 28%); }
.feature-dialog::backdrop { background: rgb(11 24 43 / 54%); backdrop-filter: blur(2px); }
.feature-dialog form { padding: 27px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.dialog-heading h2 { margin: 6px 0 0; color: #203650; font-size: 20px; letter-spacing: -.03em; }
.dialog-close { display: grid; place-items: center; min-height: 31px; width: 31px; padding: 0; border: 1px solid #dce4ef; border-radius: 7px; background: #fff; color: #5d6f87; font-size: 21px; line-height: 1; }
.dialog-hint { margin: 19px 0; color: #738197; font-size: 13px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 20px; }
.dialog-actions button { min-width: 170px; padding: 0 15px; }
.cost-badge { color: #4b7c60; font-size: 11px; font-weight: 800; }
.feature-result { max-height: 320px; margin: 15px 0 0; padding: 14px; overflow: auto; border: 1px solid #dfe6ef; border-radius: 8px; background: #f7f9fc; color: #31445e; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.feature-page { min-height: 100vh; background: #f4f6f9; }
.feature-page-header { display: flex; align-items: center; min-height: 68px; padding: 0 max(24px, calc((100% - 1180px) / 2)); border-bottom: 1px solid #e2e7ee; background: #fff; }
.feature-page-header .dashboard-brand { margin-right: 44px; }
.page-nav { display: flex; gap: 24px; }
.feature-user { display: flex; align-items: center; gap: 15px; margin-left: auto; }
.token-pill { padding: 6px 9px; border-radius: 20px; background: #eff6ff; color: #3971ae; font-size: 11px; font-weight: 800; }
.feature-user button { min-height: 35px; padding: 0 13px; font-size: 11px; }
.feature-page-intro, .feature-page-grid { width: min(100% - 48px, 1180px); margin-right: auto; margin-left: auto; }
.feature-page-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 48px 0 28px; }
.feature-page-intro h1 { margin: 8px 0; color: #1b2d47; font-size: 29px; letter-spacing: -.04em; }
.feature-page-intro p:not(.section-label) { margin: 0; color: #748398; font-size: 13px; }
.maintenance-banner { max-width: 370px; padding: 11px 14px; border: 1px solid #f0d4b8; border-radius: 8px; background: #fff9f1; color: #9a6531; font-size: 12px; line-height: 1.45; }
.feature-page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #e1e8f1; border-radius: 11px; overflow: hidden; box-shadow: 0 4px 17px rgb(35 54 85 / 4%); }

.preview-body { background: #f4f6f9; }
.preview-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.preview-sidebar { display: flex; flex-direction: column; padding: 28px 18px; background: #14233a; color: #cbd8e9; }
.preview-logo { display: flex; align-items: center; color: inherit; text-decoration: none; padding: 0 10px; }
.preview-nav { display: grid; gap: 5px; margin-top: 48px; }
.preview-nav a { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 7px; color: #9fb3ce; font-size: 13px; font-weight: 650; text-decoration: none; }
.preview-nav a span { width: 15px; color: #7398c9; text-align: center; }
.preview-nav a.active, .preview-nav a:hover { background: #203653; color: #f4f8ff; }
.preview-nav a.active span { color: #91c0ff; }
.preview-help { margin: auto 10px 4px; padding: 16px; border: 1px solid rgb(151 190 242 / 16%); border-radius: 9px; background: rgb(255 255 255 / 4%); }
.preview-help .section-label { color: #91b9ed; font-size: 9px; }
.preview-help p:last-child { margin: 9px 0 0; color: #a7bad3; font-size: 11px; line-height: 1.6; }
.preview-main { max-width: 1240px; width: 100%; margin: 0 auto; padding: 54px 60px; }
.preview-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 35px; }
.preview-header h1 { margin: 9px 0 7px; color: #172033; font-size: 30px; letter-spacing: -.04em; }
.preview-header p:not(.section-label) { margin: 0; color: #718097; font-size: 14px; }
.preview-header-actions { display: flex; align-items: center; gap: 18px; }
.preview-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #d6e0ed; border-radius: 20px; color: #63758f; font-size: 11px; font-weight: 700; background: #fff; }
.preview-badge i { width: 7px; height: 7px; border-radius: 50%; background: #f3a333; }
.return-link { color: #3a6aa3; font-size: 12px; font-weight: 700; text-decoration: none; }
.return-link:hover { text-decoration: underline; }
.preview-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.metric-card { min-height: 154px; padding: 21px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgb(36 54 85 / 3%); }
.metric-label { display: flex; justify-content: space-between; color: #75849a; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.metric-label span { color: #5f8fcd; font-size: 14px; }
.metric-card strong { display: block; margin: 23px 0 6px; color: #223754; font-size: 27px; letter-spacing: -.04em; }
.metric-card small { color: #8794a6; font-size: 11px; }
.metric-card .status-active { color: #278b5f; }
.preview-panel { margin-top: 28px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgb(36 54 85 / 3%); }
.text-button { min-height: auto; padding: 0; background: transparent; color: #3c71af; font-size: 12px; }
.text-button:hover { background: transparent; color: #1d579d; }
.activity-table { padding: 0 22px; }
.activity-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 1fr 80px; gap: 20px; align-items: center; min-height: 65px; border-top: 1px solid #edf1f5; color: #75849a; font-size: 12px; }
.activity-row > span:first-child { display: grid; gap: 3px; }
.activity-row b { color: #344861; font-size: 12px; }
.activity-row small { color: #94a0b0; font-size: 10px; }
.activity-title { min-height: 44px; border-top: 0; color: #8997a9; font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.amount { justify-self: end; font-weight: 800; }
.amount.positive { color: #23885d; }
.amount.negative { color: #b76464; }
.account-preview { margin-bottom: 10px; }
.security-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.security-grid > div { display: flex; gap: 12px; padding: 20px; }
.security-grid > div + div { border-left: 1px solid #edf1f5; }
.security-icon { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 8px; background: #edf5ff; color: #3978ca; font-weight: 800; }
.security-grid b { color: #334863; font-size: 12px; }
.security-grid p { margin: 5px 0 0; color: #8391a4; font-size: 11px; line-height: 1.5; }

@media (max-width: 760px) {
  .app-shell { width: 100%; padding: 0; }
  .auth-layout, .dashboard { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .auth-layout { display: block; }
  .brand-panel { min-height: 205px; padding: 28px; }
  .brand-copy { margin: 25px 0 0; }
  .brand-copy h1 { max-width: none; font-size: 27px; }
  .brand-copy p, .security-list, .brand-foot { display: none; }
  .auth-content { padding: 36px 28px; }
  .dashboard { padding: 25px 20px; }
  .dashboard-brand { display: none; }
  .dashboard-header > div:nth-child(2) { margin-right: 0; }
  .stats { grid-template-columns: 1fr; }
  .dashboard-actions .secure-badge { display: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-page-intro { padding-top: 34px; }
  .preview-shell { display: block; }
  .preview-sidebar { min-height: auto; padding: 18px 20px; }
  .preview-nav, .preview-help { display: none; }
  .preview-main { padding: 30px 20px; }
  .preview-header { gap: 18px; flex-direction: column; padding-bottom: 27px; }
  .preview-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .preview-header-actions .preview-badge {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .preview-header-actions .return-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #d8e3ef;
    border-radius: 8px;
    background: #fff;
  }
  .preview-header-actions button { width: 100%; min-height: 40px; }
  .preview-overview { grid-template-columns: 1fr; }
  .metric-card { min-height: 120px; }
  .metric-card strong { margin-top: 16px; }
  .activity-table { padding: 0 16px; }
  .activity-row { grid-template-columns: minmax(0, 1fr) 88px; gap: 10px; }
  .activity-row > span:nth-child(2) { color: #96a1b1; font-size: 10px; text-align: right; }
  .activity-row > span:nth-child(3) { display: none; }
  .activity-title > span:nth-child(2) { text-align: right; }
  .security-grid { grid-template-columns: 1fr; }
  .security-grid > div + div { border-top: 1px solid #edf1f5; border-left: 0; }
}

@media (max-width: 420px) {
  .auth-content { padding: 30px 22px; }
  .actions { grid-template-columns: 1fr; }
  .auth-topline { align-items: flex-start; gap: 10px; flex-direction: column; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 86px; }
  .dashboard-header { align-items: flex-start; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .dialog-actions button { width: 100%; }
  .feature-page-header {
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 14px 18px;
  }
  .feature-page-header .dashboard-brand { margin-right: auto; }
  .page-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 28px;
    padding-top: 10px;
    border-top: 1px solid #edf1f5;
  }
  .feature-user .token-pill { display: none; }
  .feature-user { margin-left: 0; }
  .feature-user button { min-height: 38px; padding: 0 15px; }
  .feature-page-intro, .feature-page-grid { width: min(100% - 32px, 1180px); }
  .feature-page-intro { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .secure-badge i { animation: none; }
}

/* Premium visual layer shared by authentication, dashboard, and feature pages. */
body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgb(107 163 234 / 12%), transparent 28rem),
    radial-gradient(circle at 92% 90%, rgb(42 167 123 / 8%), transparent 24rem),
    #f4f7fb;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  content: "";
  border-radius: 50%;
  filter: blur(2px);
}

body::before {
  top: 8%;
  left: -7rem;
  width: 19rem;
  height: 19rem;
  background: radial-gradient(circle, rgb(92 157 235 / 16%), rgb(92 157 235 / 0%) 70%);
  animation: ambient-drift 16s ease-in-out infinite alternate;
}

body::after {
  right: -8rem;
  bottom: 5%;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgb(48 182 135 / 12%), rgb(48 182 135 / 0%) 68%);
  animation: ambient-drift 20s ease-in-out -5s infinite alternate-reverse;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.auth-layout {
  position: relative;
  border-color: #dbe5f1;
  box-shadow: 0 30px 90px rgb(26 54 91 / 15%), 0 3px 10px rgb(26 54 91 / 5%);
  animation: page-rise .7s cubic-bezier(.2, .75, .25, 1) both;
}

.brand-panel {
  background:
    linear-gradient(145deg, rgb(23 52 88 / 96%), rgb(10 29 54 / 99%)),
    #14233a;
}

.brand-panel::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  top: -170px;
  right: -110px;
  border: 1px solid rgb(145 193 255 / 24%);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgb(145 193 255 / 4%), 0 0 0 54px rgb(145 193 255 / 3%);
}

.brand-panel::after {
  border-color: rgb(111 174 255 / 16%);
}

.brand-copy h1 {
  font-weight: 730;
  text-wrap: balance;
}

.auth-content {
  position: relative;
  background: linear-gradient(160deg, #fff 0%, #fbfdff 100%);
}

.auth-content::after {
  content: "";
  position: absolute;
  right: 46px;
  bottom: 42px;
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c7d8ec);
}

.actions button:first-child {
  box-shadow: 0 8px 17px rgb(36 100 189 / 20%);
}

body.authenticated .app-shell {
  background: #f4f7fb;
}

.preview-sidebar {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgb(112 170 243 / 16%), transparent 15rem),
    linear-gradient(180deg, #142a49 0%, #0e1d35 100%);
  box-shadow: 8px 0 28px rgb(20 42 73 / 7%);
}

.preview-sidebar::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 150px;
  width: 90px;
  height: 90px;
  border: 1px solid rgb(138 187 246 / 18%);
  border-radius: 50%;
}

.preview-main {
  max-width: 1320px;
}

.preview-header h1 {
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 720;
}

.preview-overview .metric-card {
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: card-rise .55s cubic-bezier(.2, .75, .25, 1) both;
}

.preview-overview .metric-card:nth-child(2) { animation-delay: .08s; }
.preview-overview .metric-card:nth-child(3) { animation-delay: .16s; }

.preview-overview .metric-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 110px;
  height: 110px;
  border: 1px solid rgb(62 124 197 / 12%);
  border-radius: 50%;
}

.preview-overview .metric-card:hover {
  border-color: #c5d9f0;
  box-shadow: 0 12px 28px rgb(36 75 122 / 10%);
  transform: translateY(-2px);
}

.preview-panel {
  box-shadow: 0 6px 22px rgb(36 54 85 / 4%);
  animation: page-rise .65s .18s cubic-bezier(.2, .75, .25, 1) both;
}

.feature-page {
  background:
    radial-gradient(circle at 80% 0%, rgb(104 163 235 / 10%), transparent 28rem),
    #f4f7fb;
}

.feature-page-header {
  min-height: 76px;
  box-shadow: 0 2px 12px rgb(27 54 89 / 4%);
}

.feature-page-grid {
  box-shadow: 0 12px 32px rgb(35 54 85 / 7%);
}

.feature-card {
  position: relative;
  transition: background .18s ease, transform .18s ease;
  animation: card-rise .5s cubic-bezier(.2, .75, .25, 1) both;
}

.feature-card:nth-child(2) { animation-delay: .04s; }
.feature-card:nth-child(3) { animation-delay: .08s; }
.feature-card:nth-child(4) { animation-delay: .12s; }
.feature-card:nth-child(5) { animation-delay: .16s; }
.feature-card:nth-child(6) { animation-delay: .2s; }

.feature-card:not(:disabled):hover {
  position: relative;
  z-index: 1;
  box-shadow: 0 6px 18px rgb(36 100 189 / 10%);
  transform: translateY(-2px);
}

.feature-meta.maintenance {
  color: #aa6c37;
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(155deg, #eaf3ff 0%, #f4f8fd 48%, #eef9f5 100%);
  }

  .auth-content {
    background:
      radial-gradient(circle at 100% 0%, rgb(104 167 239 / 18%), transparent 15rem),
      linear-gradient(160deg, #fafdff 0%, #eef6ff 100%);
  }

  body.authenticated .app-shell,
  .preview-main {
    background:
      radial-gradient(circle at 100% 0%, rgb(91 157 234 / 15%), transparent 17rem),
      linear-gradient(155deg, #edf5ff 0%, #f7fbff 52%, #eef9f5 100%);
  }

  .preview-overview .metric-card {
    background: rgb(255 255 255 / 82%);
    backdrop-filter: blur(8px);
  }

  .preview-panel {
    background: rgb(255 255 255 / 88%);
    backdrop-filter: blur(8px);
  }

  .auth-content::after,
  .preview-sidebar::after {
    display: none;
  }

  .preview-sidebar {
    min-height: auto;
  }

  .preview-header h1 {
    font-size: 27px;
  }
}

@keyframes ambient-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(5rem, 2rem, 0) scale(1.18); }
}

@keyframes page-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .auth-layout,
  .preview-overview .metric-card,
  .preview-panel,
  .feature-card {
    animation: none;
  }
}

/* High-contrast preview treatment: the preview must look visibly different from a blank page. */
body.preview-body {
  background:
    radial-gradient(circle at 8% 8%, rgb(44 133 226 / 30%), transparent 25rem),
    radial-gradient(circle at 90% 80%, rgb(30 188 153 / 20%), transparent 26rem),
    #dcecff;
}

body.preview-body .preview-main {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 72%), rgb(230 243 255 / 76%)),
    radial-gradient(circle at 90% 0%, rgb(68 166 238 / 20%), transparent 22rem);
}

body.preview-body .preview-header {
  position: relative;
}

body.preview-body .preview-header::after {
  position: absolute;
  right: 0;
  bottom: 20px;
  width: 150px;
  height: 4px;
  content: "";
  border-radius: 9px;
  background: linear-gradient(90deg, #37a6ee, #36c99a);
  box-shadow: 0 0 18px rgb(54 180 185 / 45%);
}

body.preview-body .metric-card {
  border-color: rgb(104 166 226 / 36%);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 94%), rgb(225 241 255 / 94%)),
    #fff;
  box-shadow: 0 12px 28px rgb(47 111 177 / 15%);
}

body.preview-body .metric-card:nth-child(2) {
  border-color: rgb(77 190 153 / 38%);
  background: linear-gradient(145deg, #fafffe, #e5faf1);
}

body.preview-body .metric-card:nth-child(3) {
  border-color: rgb(157 126 225 / 32%);
  background: linear-gradient(145deg, #fff, #f1ebff);
}

body.preview-body .preview-panel {
  border-color: rgb(112 168 222 / 30%);
  background: rgb(255 255 255 / 91%);
  box-shadow: 0 14px 32px rgb(42 100 163 / 12%);
}

body.preview-body .preview-panel .panel-heading {
  background: linear-gradient(90deg, rgb(238 248 255 / 88%), rgb(248 255 252 / 88%));
}

body.preview-body .security-grid > div:first-child .security-icon {
  background: #dff1ff;
  color: #267fc1;
}

body.preview-body .security-grid > div:last-child .security-icon {
  background: #def8ed;
  color: #268f68;
}

/* Keep page navigation in a stable side rail on desktop. */
.feature-page {
  min-height: 100vh;
  padding-left: 236px;
}

.feature-page-header {
  position: fixed;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 236px;
  min-height: 100vh;
  flex-direction: column;
  align-items: stretch;
  padding: 28px 18px;
  border: 0;
  background:
    radial-gradient(circle at 20% 10%, rgb(112 170 243 / 16%), transparent 15rem),
    linear-gradient(180deg, #142a49 0%, #0e1d35 100%);
  box-shadow: 8px 0 28px rgb(20 42 73 / 8%);
}

.feature-page-header .dashboard-brand {
  margin: 0;
  padding: 0 10px;
}

.feature-page-header .page-nav {
  display: grid;
  gap: 5px;
  margin-top: 48px;
}

.feature-page-header .page-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #9fb3ce;
}

.feature-page-header .page-nav a:hover,
.feature-page-header .page-nav a.active {
  background: #203653;
  color: #f4f8ff;
}

.feature-page-header .feature-user {
  margin-top: auto;
  margin-left: 0;
  padding: 16px 10px 4px;
  border-top: 1px solid rgb(159 193 229 / 16%);
}

.feature-page-header .token-pill {
  background: rgb(125 188 255 / 15%);
  color: #a7d0ff;
}

.feature-page-header .feature-user button {
  width: 100%;
  border-color: rgb(159 193 229 / 28%);
  background: rgb(255 255 255 / 7%);
  color: #e5f0ff;
}

.dashboard-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-links .return-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
}

.side-logout {
  width: 100%;
  min-height: 38px;
  margin: auto 10px 4px;
  width: calc(100% - 20px);
  border-color: rgb(159 193 229 / 28%);
  background: rgb(255 255 255 / 7%);
  color: #e5f0ff;
}

@media (max-width: 760px) {
  .feature-page {
    padding-left: 0;
  }

  .feature-page-header {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
  }

  .feature-page-header .page-nav {
    display: flex;
    margin-top: 0;
  }

  .feature-page-header .page-nav a {
    min-height: 36px;
  }

  .feature-page-header .feature-user {
    margin-top: 0;
    padding: 0;
    border-top: 0;
  }

  .preview-header-actions {
    align-items: stretch;
  }

  .dashboard-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 10px;
  }

  .dashboard-links .return-link {
    width: 100%;
    min-height: 42px;
    padding: 0 8px;
    font-size: 11px;
  }

  .preview-header-actions > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .feature-page-header {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .feature-page-header .dashboard-brand {
    margin-right: auto;
  }

  .feature-page-header .page-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgb(159 193 229 / 16%);
  }

  .feature-page-header .page-nav a {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
    font-size: 11px;
  }

  .feature-page-header .feature-user button {
    width: auto;
    min-height: 36px;
    padding: 0 13px;
  }

  .dashboard.preview-shell {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: stretch;
    min-height: 100vh;
  }

  .dashboard.preview-shell .preview-sidebar {
    display: flex;
    min-height: 100vh;
    padding: 18px 8px;
  }

  .dashboard.preview-shell .preview-logo {
    justify-content: center;
    padding: 0;
  }

  .dashboard.preview-shell .preview-logo .brand-name {
    display: none;
  }

  .dashboard.preview-shell .preview-logo .brand-mark {
    margin: 0;
  }

  .dashboard.preview-shell .preview-nav {
    display: grid;
    gap: 8px;
    margin-top: 28px;
  }

  .dashboard.preview-shell .preview-nav a {
    justify-content: center;
    min-height: 42px;
    padding: 0;
    font-size: 0;
  }

  .dashboard.preview-shell .preview-nav a span {
    width: auto;
    font-size: 17px;
  }

  .dashboard.preview-shell .side-logout {
    min-height: 36px;
    margin: auto 0 3px;
    width: 100%;
    padding: 0;
    font-size: 0;
  }

  .dashboard.preview-shell .side-logout::before {
    content: "↪";
    font-size: 17px;
  }

  .dashboard.preview-shell .preview-help {
    display: none;
  }

  .dashboard.preview-shell .preview-main {
    min-width: 0;
    padding: 24px 14px;
  }

  .dashboard.preview-shell .preview-header-actions {
    justify-content: flex-start;
  }

  .dashboard.preview-shell .preview-header-actions .preview-badge {
    grid-column: auto;
  }
}

.payment-hero,
.payment-layout,
.payment-history {
  width: min(100% - 48px, 1180px);
  margin-right: auto;
  margin-left: auto;
}

.payment-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 48px 0 28px;
}

.payment-hero h1 {
  margin: 8px 0;
  color: #1b2d47;
  font-size: 32px;
  letter-spacing: -.04em;
}

.payment-hero p:not(.section-label) {
  margin: 0;
  color: #718097;
  font-size: 13px;
}

.payment-balance {
  min-width: 190px;
  padding: 17px 20px;
  border: 1px solid #b9dfd0;
  border-radius: 13px;
  background: linear-gradient(145deg, #f7fffc, #e2f8ee);
  box-shadow: 0 8px 24px rgb(38 145 103 / 10%);
}

.payment-balance span,
.payment-balance small {
  display: block;
  color: #5c8876;
  font-size: 11px;
}

.payment-balance strong {
  display: inline-block;
  margin: 4px 5px 0 0;
  color: #20835c;
  font-size: 27px;
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
  gap: 18px;
}

.payment-card {
  border: 1px solid #dce7f2;
  border-radius: 14px;
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 10px 28px rgb(37 83 130 / 7%);
}

.purchase-card,
.instructions-card {
  padding: 24px;
}

.payment-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-card-heading h2 {
  margin: 5px 0 0;
  color: #203650;
  font-size: 17px;
}

.payment-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #e3f0ff;
  color: #3679c7;
  font-weight: 850;
}

.payment-icon.green {
  background: #def8ed;
  color: #258b62;
}

.payment-copy,
.payment-note,
.payment-instruction {
  color: #718097;
  font-size: 12px;
  line-height: 1.6;
}

.payment-copy { margin: 20px 0; }
.purchase-card form { display: grid; gap: 14px; }
.purchase-card fieldset { display: grid; gap: 14px; padding: 0; margin: 0; border: 0; }
.purchase-card fieldset:disabled { opacity: .48; cursor: not-allowed; }
.purchase-card button,
.reference-form button { width: 100%; }
.payment-countdown {
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid #f1d4a9;
  border-radius: 8px;
  background: #fff8eb;
  color: #9a692d;
  font-size: 12px;
  text-align: center;
}
.payment-countdown strong { margin-left: 4px; font-size: 16px; letter-spacing: .06em; }

.order-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 20px 0;
}

.order-summary div {
  padding: 11px;
  border-radius: 9px;
  background: #f1f7ff;
}

.order-summary span,
.order-summary strong {
  display: block;
}

.order-summary span { color: #7890aa; font-size: 10px; }
.order-summary strong { margin-top: 5px; color: #29496d; font-size: 13px; overflow-wrap: anywhere; }
.payment-qris { display: block; width: min(100%, 210px); max-height: 210px; margin: 10px auto 17px; object-fit: contain; border-radius: 10px; }
.reference-form { display: grid; gap: 12px; }

.payment-history {
  margin-top: 18px;
  margin-bottom: 40px;
  overflow: hidden;
}

.payment-orders { padding: 0 20px; }
.payment-order-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) 110px 110px 120px auto;
  gap: 15px;
  align-items: center;
  min-height: 64px;
  border-top: 1px solid #edf1f5;
  color: #536a84;
  font-size: 12px;
}

.payment-order-row > div { display: grid; gap: 3px; }
.payment-order-row small { color: #91a0b2; font-size: 10px; }
.payment-order-row > b:last-child { color: #29496d; text-align: right; }
.order-status { justify-self: start; padding: 5px 8px; border-radius: 15px; background: #eef4fb; color: #5b7696; font-size: 10px; font-weight: 800; }
.order-status.pending, .order-status.pending_proof { background: #fff3df; color: #a76b2d; }
.order-status.paid, .order-status.completed { background: #e1f8ed; color: #25845d; }
.view-payment-button { min-height: 32px; padding: 0 10px; border: 1px solid #c9dced; border-radius: 7px; background: #f4f9ff; color: #3570aa; font-size: 11px; font-weight: 750; }
.view-payment-button:hover { background: #e5f2ff; }
.empty-payment { padding: 24px 0; color: #7d8b9e; font-size: 13px; }

@media (max-width: 760px) {
  .payment-hero,
  .payment-layout,
  .payment-history {
    width: min(100% - 32px, 1180px);
  }
  .payment-hero { align-items: flex-start; flex-direction: column; padding-top: 32px; }
  .payment-balance { width: 100%; }
  .payment-layout { grid-template-columns: 1fr; }
  .order-summary { grid-template-columns: 1fr; }
  .payment-order-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 0; }
  .payment-order-row > span { grid-column: 2; grid-row: 1; }
  .payment-order-row > b:last-child { grid-column: 2; grid-row: 2; }
  .payment-order-row .view-payment-button { grid-column: 1 / -1; grid-row: 3; width: 100%; }
}
