:root {
  --p-blue-900: #103F58;   /* dasar gelap, turunan Bermuda Blue */
  --p-blue-800: #185D82;   /* Bermuda Blue 2061-30 */
  --p-blue-500: #84BBDC;   /* Blue Marguerite 2063-50 */
  --p-blue-100: #B1D9E9;   /* Sapphireberry 2063-60 */
  --p-blue-50:  #EAF5FA;
  --p-orange-600: #D25F12;
  --p-orange-500: #F0701A; /* Electric Orange 2015-10 */
  --p-orange-400: #FC9537; /* Carrot Stick 2016-30 */
  --p-ink: #14324A;
  --p-text-muted: #5C7488;
  --p-paper: #F7FAFC;
  --p-white: #FFFFFF;
  --p-danger: #C0392B;
  --p-success: #2F9E58;
  --p-radius: 14px;
  --p-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --p-font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.portal-body {
  font-family: var(--p-font);
  background: var(--p-paper);
  color: var(--p-ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ===================== GUEST (login/register) ===================== */
.guest-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
@media (max-width: 900px) {
  .guest-shell { grid-template-columns: 1fr; }
  .guest-shell__promo { display: none; }
}
.guest-shell__promo {
  background: linear-gradient(160deg, var(--p-blue-900), var(--p-blue-800) 55%, var(--p-orange-500) 145%);
  color: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.guest-shell__promo::after {
  content: "";
  position: absolute; inset: auto -10% -30% auto;
  width: 420px; height: 420px; border-radius: 50%;
  background: rgba(240,112,26,.28);
  filter: blur(10px);
}
.guest-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; position: relative; z-index: 1; }
.guest-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--p-orange-500); }
.guest-shell__promo h1 {
  font-family: var(--p-font-display); font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15; margin: 32px 0 16px; position: relative; z-index: 1;
}
.guest-shell__promo p { color: rgba(255,255,255,.82); max-width: 420px; position: relative; z-index: 1; }
.guest-shell__list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.guest-shell__list li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.92); font-size: .95rem; }
.guest-shell__list li svg { flex: none; margin-top: 2px; color: var(--p-orange-400); }
.guest-shell__foot { font-size: .8rem; color: rgba(255,255,255,.6); position: relative; z-index: 1; }

.guest-shell__form {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.guest-card { width: 100%; max-width: 400px; }
.guest-card__back { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--p-text-muted); font-weight: 600; margin-bottom: 24px; }
.guest-card h2 { font-family: var(--p-font-display); font-size: 1.7rem; margin: 0 0 6px; color: var(--p-blue-900); }
.guest-card > p.sub { color: var(--p-text-muted); margin: 0 0 28px; }

.p-field { margin-bottom: 18px; }
.p-field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; color: var(--p-blue-900); }
.p-field input, .p-field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid #DCE7EE;
  background: var(--p-white); font-size: .95rem; font-family: inherit; color: var(--p-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.p-field input:focus, .p-field select:focus {
  outline: none; border-color: var(--p-orange-500); box-shadow: 0 0 0 3px rgba(240,112,26,.15);
}
.p-field-hint { font-size: .78rem; color: var(--p-text-muted); margin-top: 5px; }

.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 20px; border-radius: 999px; border: none;
  background: var(--p-orange-500); color: #fff; font-weight: 700; font-size: .95rem;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 6px 16px rgba(240,112,26,.35);
}
.p-btn:hover { background: var(--p-orange-600); transform: translateY(-1px); }
.p-btn--outline { background: transparent; color: var(--p-blue-800); border: 1.5px solid var(--p-blue-800); box-shadow: none; }
.p-btn--outline:hover { background: var(--p-blue-800); color: #fff; }

.guest-card__switch { text-align: center; margin-top: 22px; font-size: .9rem; color: var(--p-text-muted); }
.guest-card__switch a { color: var(--p-orange-600); font-weight: 700; }

.p-alert { padding: 12px 16px; border-radius: 10px; font-size: .88rem; margin-bottom: 18px; font-weight: 600; }
.p-alert--error { background: #FDECEA; color: var(--p-danger); border: 1px solid #F6C4BE; }
.p-alert--success { background: #E7F7ED; color: var(--p-success); border: 1px solid #B9E6C7; }

/* ===================== APP SHELL (logged-in) ===================== */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 252px; flex: none;
  background: var(--p-blue-900);
  color: rgba(255,255,255,.85);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.app-sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; color: #fff; font-weight: 800; }
.app-sidebar__brand .badge { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; background: var(--p-orange-500); color: #fff; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.app-sidebar__nav { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.app-sidebar__nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  font-weight: 600; font-size: .92rem; color: rgba(255,255,255,.72);
}
.app-sidebar__nav a svg { flex: none; opacity: .85; }
.app-sidebar__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar__nav a.active { background: var(--p-orange-500); color: #fff; box-shadow: 0 4px 12px rgba(240,112,26,.35); }
.app-sidebar__foot { padding: 16px 14px 22px; border-top: 1px solid rgba(255,255,255,.1); }
.app-sidebar__user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 14px; }
.app-sidebar__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--p-blue-500); color: var(--p-blue-900); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.app-sidebar__user div p { margin: 0; }
.app-sidebar__user .name { font-size: .88rem; font-weight: 700; color: #fff; }
.app-sidebar__user .role { font-size: .75rem; color: rgba(255,255,255,.55); }
.app-sidebar__logout { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: .88rem; color: rgba(255,255,255,.72); width: 100%; background: none; border: none; cursor: pointer; text-align: left; }
.app-sidebar__logout:hover { background: rgba(255,255,255,.06); color: #fff; }

.app-topbar {
  display: none;
  align-items: center; justify-content: space-between;
  background: var(--p-blue-900); color: #fff; padding: 14px 18px; position: sticky; top: 0; z-index: 20;
}
.app-topbar__brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.app-topbar__toggle { background: none; border: none; color: #fff; cursor: pointer; }

.app-main { flex: 1; min-width: 0; }
.app-main__inner { padding: 32px 36px 60px; max-width: 1080px; margin: 0 auto; }

@media (max-width: 880px) {
  .app-sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 40px rgba(0,0,0,.25); }
  .app-sidebar.open { transform: translateX(0); }
  .app-topbar { display: flex; }
  .app-main__inner { padding: 22px 16px 48px; }
}

.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.app-header h1 { font-family: var(--p-font-display); font-size: 1.7rem; margin: 0 0 4px; color: var(--p-blue-900); }
.app-header p { margin: 0; color: var(--p-text-muted); }

.p-grid { display: grid; gap: 18px; }
.p-grid--4 { grid-template-columns: repeat(4, 1fr); }
.p-grid--3 { grid-template-columns: repeat(3, 1fr); }
.p-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .p-grid--4, .p-grid--3, .p-grid--2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .p-grid--4, .p-grid--3, .p-grid--2 { grid-template-columns: 1fr; } }

.p-card {
  background: var(--p-white); border-radius: var(--p-radius); padding: 22px;
  border: 1px solid #E7EEF3; box-shadow: 0 2px 10px rgba(20,50,74,.04);
}
.p-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--p-blue-900); }
.p-card .p-card__label { font-size: .8rem; color: var(--p-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.p-card .p-card__value { font-family: var(--p-font-display); font-size: 1.7rem; color: var(--p-blue-900); margin: 6px 0 0; }

.p-card--accent { background: linear-gradient(135deg, var(--p-blue-800), var(--p-blue-900)); color: #fff; border: none; }
.p-card--accent .p-card__label { color: rgba(255,255,255,.7); }
.p-card--accent .p-card__value { color: #fff; }

.p-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.p-badge--success { background: #E7F7ED; color: var(--p-success); }
.p-badge--warning { background: #FFF3E0; color: var(--p-orange-600); }
.p-badge--muted { background: #EEF2F5; color: var(--p-text-muted); }

.p-section { margin-top: 34px; }
.p-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.p-section__head h2 { font-family: var(--p-font-display); font-size: 1.25rem; margin: 0; color: var(--p-blue-900); }
.p-section__head a { font-size: .85rem; font-weight: 700; color: var(--p-orange-600); }

.p-table { width: 100%; border-collapse: collapse; background: var(--p-white); border-radius: var(--p-radius); overflow: hidden; border: 1px solid #E7EEF3; }
.p-table th, .p-table td { padding: 12px 16px; text-align: left; font-size: .88rem; border-bottom: 1px solid #EEF2F5; }
.p-table th { background: var(--p-blue-50); color: var(--p-blue-900); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.p-table tr:last-child td { border-bottom: none; }
.p-table td.amount-in { color: var(--p-success); font-weight: 700; }
.p-table td.amount-out { color: var(--p-danger); font-weight: 700; }

.p-empty { text-align: center; padding: 44px 20px; color: var(--p-text-muted); background: var(--p-white); border-radius: var(--p-radius); border: 1px dashed #DCE7EE; }
.p-empty strong { display: block; color: var(--p-blue-900); margin-bottom: 4px; }

.p-list { display: grid; gap: 14px; }
.p-list-item { background: var(--p-white); border: 1px solid #E7EEF3; border-radius: var(--p-radius); padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.p-list-item__main strong { display: block; color: var(--p-blue-900); font-size: 1rem; margin-bottom: 3px; }
.p-list-item__meta { font-size: .82rem; color: var(--p-text-muted); }
.p-list-item__note { margin-top: 8px; font-size: .88rem; color: var(--p-ink); }

.promo-card { background: linear-gradient(135deg, var(--p-orange-500), var(--p-orange-400)); color: #fff; border-radius: var(--p-radius); padding: 20px 22px; position: relative; overflow: hidden; }
.promo-card h3 { color: #fff; margin: 0 0 6px; }
.promo-card p { margin: 0 0 12px; color: rgba(255,255,255,.9); font-size: .9rem; }
.promo-card__code { display: inline-block; background: rgba(255,255,255,.2); border: 1px dashed rgba(255,255,255,.6); padding: 5px 12px; border-radius: 8px; font-weight: 800; letter-spacing: .04em; font-size: .82rem; }
.promo-card__expiry { margin-top: 10px; font-size: .78rem; color: rgba(255,255,255,.8); }
