/* =====================================================================
   SULI 5 — portal agen & CRM internal.
   Bahasa desain mengikuti landing page: biru royal + aksen merah,
   permukaan putih bersih, kartu membulat, serif display untuk judul.
   ===================================================================== */

:root {
  --blue-900: #081551;
  --blue-800: #0B1B5C;
  --blue-700: #12299B;
  --blue-600: #1B34C8;
  --blue-500: #2C4BE0;
  --blue-300: #8FA6F5;
  --blue-100: #DCE4FF;
  --sky: #EAF0FF;
  --tint: #F4F7FF;
  --red: #E01F26;
  --red-dark: #B8131A;
  --green: #12a05a;
  --amber: #C77700;
  --ink: #0D1230;
  --muted: #5B6488;
  --line: #E2E8F8;
  --white: #fff;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(13, 18, 48, .06);
  --shadow: 0 18px 40px -18px rgba(13, 24, 78, .28);
  --shadow-lg: 0 34px 70px -28px rgba(9, 20, 74, .38);

  --font-display: "Playfair Display", Georgia, serif;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --sidebar-w: 254px;
  --bottomnav-h: 66px;
}

*, *::before, *::after { box-sizing: border-box; }

body.portal {
  margin: 0;
  background: var(--tint);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }

:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------- lockup logo */
.lockup {
  display: inline-flex;
  align-items: flex-start;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
}
.lockup__word { color: #fff; }
.lockup__five { color: #FF6B72; margin-left: 3px; }
.lockup__star { width: 1em; height: 1em; margin: -.02em .06em 0 .02em; }

/* ------------------------------------------------------------ utilities */
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.stack { display: grid; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --------------------------------------------------------------- alerts */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .92rem;
  border: 1px solid var(--line);
  background: #fff;
}
.alert--ok { background: #E9F8F0; border-color: #BFE9D2; color: #0C6B3D; }
.alert--error { background: #FFF4F4; border-color: #F7D4D6; color: #8E161C; }
.alert--info { background: var(--sky); border-color: var(--blue-100); color: var(--blue-700); }
.alert .ic { margin-top: 1px; }

/* -------------------------------------------------------------- tombol */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-align: center;
}
.btn--primary {
  background: linear-gradient(120deg, var(--blue-600), var(--blue-500));
  color: #fff;
  box-shadow: 0 14px 28px -16px rgba(27, 52, 200, .85);
}
.btn--red { background: linear-gradient(120deg, var(--red), #F0484F); color: #fff; box-shadow: 0 14px 28px -16px rgba(224, 31, 38, .8); }
.btn--wa { background: linear-gradient(120deg, #1FA855, #25C268); color: #fff; box-shadow: 0 14px 28px -16px rgba(31, 168, 85, .9); }
.btn--ghost { background: #fff; color: var(--blue-700); border: 1.4px solid var(--blue-100); }
.btn--quiet { background: var(--sky); color: var(--blue-700); }
.btn--sm { padding: 8px 14px; font-size: .82rem; }
.btn--xs { padding: 6px 11px; font-size: .76rem; }
.btn--block { width: 100%; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.iconbtn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  flex: none;
}
.iconbtn:hover { background: rgba(255, 255, 255, .2); }
.iconbtn__dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* ======================================================== PORTAL AGEN */
.appbar {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-700) 70%, #1C3AC4);
  color: #fff;
  padding: 14px 18px 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 12px 30px -20px rgba(9, 20, 74, .8);
}
.appbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.appbar__brand { display: inline-flex; align-items: center; padding: 4px 0; }
.appbar__sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.chip-tag {
  font-size: .74rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #E4EAFF;
}
.chip-tag--level { background: rgba(255, 255, 255, .95); color: var(--blue-700); border-color: #fff; }
.chip-tag--points { background: rgba(224, 31, 38, .22); border-color: rgba(255, 255, 255, .3); color: #FFD9DB; }

.userbox { display: inline-flex; align-items: center; gap: 10px; }
.userbox__who { display: none; }
@media (min-width: 560px) {
  .userbox__who { display: grid; line-height: 1.25; font-size: .8rem; text-align: right; }
  .userbox__who strong { font-weight: 700; }
  .userbox__who span { color: rgba(255, 255, 255, .7); font-size: .72rem; }
}

.agent-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 18px calc(var(--bottomnav-h) + 34px);
}
.agent-h1 { font-size: 1.7rem; margin-bottom: 4px; }
.agent-sub { color: var(--muted); margin-bottom: 20px; font-size: .93rem; }

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav__item {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 4px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 58px;
}
.bottomnav__item .ic { width: 22px; height: 22px; }
.bottomnav__item.is-active { color: var(--blue-600); }
.bottomnav__item.is-active .ic { fill: var(--blue-600); }

/* ============================================================== CRM */
.crm-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
  color: #C9D5FF;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand { display: grid; gap: 6px; padding: 0 6px; }
.sidebar__tag { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--blue-300); }
.sidebar__nav { display: grid; gap: 4px; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: .89rem;
  font-weight: 600;
  color: #C9D5FF;
  transition: background .2s ease, color .2s ease;
}
.sidebar__link .ic { width: 19px; height: 19px; }
.sidebar__link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar__link.is-active { background: #fff; color: var(--blue-700); }
.sidebar__badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-style: normal;
  font-size: .68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 7px;
}
.sidebar__foot { margin-top: auto; font-size: .78rem; padding: 0 6px; color: var(--blue-300); }
.sidebar__foot a:hover { color: #fff; }

.crm-main { padding: 0 26px 46px; min-width: 0; }
.topbar-crm {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  background: linear-gradient(180deg, var(--tint) 70%, rgba(244, 247, 255, 0));
  backdrop-filter: blur(8px);
}
.topbar-crm__title { font-size: 1.4rem; flex: 1; }
.topbar-crm .iconbtn { background: var(--white); border-color: var(--line); color: var(--blue-700); }
.topbar-crm .iconbtn:hover { background: var(--sky); }
.topbar-crm .userbox__who { color: var(--ink); }
.topbar-crm .userbox__who span { color: var(--muted); }
.sidebar-toggle { display: none; }

/* --------------------------------------------------------- kartu & grid */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card + .card { margin-top: 20px; }
.card__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card__head h2, .card__head h3 { font-size: 1.15rem; }
.card__hint { color: var(--muted); font-size: .85rem; }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat__label { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat__value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; color: var(--blue-700); margin-top: 6px; line-height: 1.1; }
.stat__value--red { color: var(--red); }
.stat__meta { font-size: .84rem; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.stat__meta a, .login__links a, .switch a { display: inline-block; padding: 2px 0; }

/* -------------------------------------------------------------- badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.st-baru { background: var(--sky); color: var(--blue-700); border-color: var(--blue-100); }
.st-diproses { background: #FFF6E5; color: var(--amber); border-color: #F6E2BB; }
.st-siap { background: #F0ECFF; color: #5B3BC4; border-color: #DED4FF; }
.st-dalam-perjalanan { background: #E8F4FF; color: #12629B; border-color: #C9E3FA; }
.st-terkirim { background: #E6F7F4; color: #0C6E63; border-color: #BEE9E2; }
.st-selesai { background: #E9F8F0; color: var(--green); border-color: #BFE9D2; }
.st-dibatalkan { background: #FFF1F1; color: var(--red-dark); border-color: #F7D4D6; }

.tag { display: inline-block; font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--sky); color: var(--blue-700); border: 1px solid var(--blue-100); }
.tag--gold { background: #FFF7E3; color: #9A6B00; border-color: #F3E2B4; }
.tag--silver { background: #F1F4F9; color: #4A5568; border-color: #DCE3EC; }

/* -------------------------------------------------------------- tabel */
.tablewrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 640px; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl th { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--tint); font-weight: 700; white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #FAFBFF; }
table.tbl .t-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------- form & input */
label.field { display: grid; gap: 6px; }
label.field > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], select, textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.4px solid var(--line);
  background: #F8FAFF;
  color: var(--ink);
  width: 100%;
  min-height: 46px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(44, 75, 224, .14);
}
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.filterbar label.field { min-width: 190px; }
.searchbox { position: relative; flex: 1 1 240px; }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); fill: var(--muted); width: 18px; height: 18px; }
.searchbox input { padding-left: 40px; }

/* ------------------------------------------------------- daftar pesanan */
.list { display: grid; gap: 14px; }
.item-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.item-card__top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.item-card__code { font-weight: 700; font-size: .95rem; }
.item-card__meta { color: var(--muted); font-size: .84rem; margin-top: 6px; display: grid; gap: 3px; }
.item-card__rows { margin-top: 12px; display: grid; gap: 6px; font-size: .88rem; }
.item-card__row { display: flex; justify-content: space-between; gap: 12px; }
.item-card__total { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; font-weight: 700; display: flex; justify-content: space-between; }
.item-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* --------------------------------------------------------- langkah pesan */
.product-pick {
  display: grid;
  gap: 14px;
}
.pick {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.pick.is-chosen { border-color: var(--blue-500); box-shadow: 0 12px 26px -18px rgba(27, 52, 200, .7); }
.pick__thumb {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  background: radial-gradient(90% 80% at 50% 20%, #EFF4FF, #D6E0FF);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pick__thumb img { max-height: 70px; width: auto; object-fit: contain; }
.pick__name { font-weight: 700; font-size: .96rem; }
.pick__price { color: var(--blue-700); font-weight: 700; margin-top: 2px; }
.pick__price small { color: var(--muted); font-weight: 500; }
.pick__best { color: var(--green); font-size: .76rem; font-weight: 700; }

.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.4px solid var(--blue-100);
  background: var(--sky);
  color: var(--blue-700);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.qty button:hover { background: #fff; }
.qty input { width: 62px; text-align: center; padding: 8px; min-height: 40px; }

.summary-bar {
  position: sticky;
  bottom: calc(var(--bottomnav-h) + 8px);
  z-index: 30;
  margin-top: 18px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}
.summary-bar__row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.summary-bar__total { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--blue-700); }

/* --------------------------------------------------------------- poin */
.reward { display: grid; gap: 6px; }
.reward__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reward__cost { font-weight: 700; color: var(--blue-700); white-space: nowrap; }
.reward__desc { color: var(--muted); font-size: .86rem; }
.points-hero {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600) 60%, #2E48D8);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow);
}
.points-hero__value { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.points-hero__label { font-size: .82rem; color: rgba(255, 255, 255, .82); }
.points-hero__note { font-size: .82rem; color: #FFD9DB; margin-top: 8px; }

.timeline { display: grid; gap: 0; }
.timeline__row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.timeline__rail { display: grid; justify-items: center; }
.timeline__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue-500); margin-top: 6px; }
.timeline__dot--done { background: var(--green); }
.timeline__dot--cancel { background: var(--red); }
.timeline__line { width: 2px; background: var(--line); flex: 1; min-height: 12px; }
.timeline__body { padding-bottom: 16px; }
.timeline__title { font-weight: 700; font-size: .92rem; }
.timeline__meta { color: var(--muted); font-size: .8rem; }

/* -------------------------------------------------------------- grafik */
.chart { width: 100%; height: 190px; }
.chart__labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 5px; }
.bar-row__top { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.bar-row__track { height: 9px; border-radius: 999px; background: var(--sky); overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue-600), var(--blue-500)); }
.bar-row__fill--red { background: linear-gradient(90deg, var(--red), #F0484F); }

/* ------------------------------------------------------------- kosong */
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; fill: var(--blue-300); }
.empty strong { color: var(--ink); font-size: 1rem; }

/* -------------------------------------------------------------- dialog */
dialog.modal {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
dialog.modal::backdrop { background: rgba(8, 21, 81, .55); backdrop-filter: blur(3px); }
.modal__head { padding: 20px 24px 0; }
.modal__body { padding: 12px 24px 4px; display: grid; gap: 14px; }
.modal__foot { padding: 18px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* -------------------------------------------------------------- pager */
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: .86rem;
  font-weight: 600;
  color: var(--blue-700);
  padding: 0 10px;
}
.pager .is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.pager .is-disabled { color: var(--muted); opacity: .5; }

/* ----------------------------------------------------------- notifikasi */
.notif { display: grid; gap: 12px; }
.notif__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.notif__item.is-unread { border-color: var(--blue-100); background: #FBFCFF; }
.notif__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sky); display: grid; place-items: center; }
.notif__icon .ic { fill: var(--blue-700); }
.notif__title { font-weight: 700; font-size: .94rem; }
.notif__msg { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.notif__time { color: var(--muted); font-size: .78rem; white-space: nowrap; }

/* ========================================================== responsif */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .crm-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    transform: translateX(-100%);
    transition: transform .28s ease;
    z-index: 60;
  }
  .sidebar.is-open { transform: none; }
  .sidebar-toggle { display: inline-grid; }
  .crm-main { padding: 0 16px 40px; }
  .backdrop { position: fixed; inset: 0; background: rgba(8, 21, 81, .5); z-index: 55; }
}

@media (max-width: 700px) {
  body.portal { font-size: 15px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; border-radius: var(--radius); }
  .agent-h1 { font-size: 1.45rem; }
  .stat__value { font-size: 1.6rem; }
  .pick { grid-template-columns: 62px minmax(0, 1fr); }
  .pick__thumb { width: 62px; height: 62px; }
  .pick__qty { grid-column: 1 / -1; }
  .tablewrap { border: 0; background: transparent; overflow: visible; }
  table.tbl { min-width: 0; display: block; }
  table.tbl thead { display: none; }
  table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
  }
  table.tbl td { border: 0; padding: 5px 0; display: flex; gap: 10px; justify-content: space-between; }
  table.tbl td::before {
    content: attr(data-label);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    font-weight: 700;
  }
  .notif__item { grid-template-columns: 34px minmax(0, 1fr); }
  .notif__time { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ================================================ HALAMAN MASUK / AUTENTIKASI */
body.portal:has(> .login), body.portal:has(> .auth-simple) { background: var(--blue-900); }

.login {
  display: grid;
  /* kolom kanan lebih lebar supaya kartu bisa memuat formulir + panel demo
     berdampingan tanpa memanjangkan halaman */
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  min-height: 100vh;
}

.login__aside {
  position: relative;
  color: #fff;
  background: linear-gradient(150deg, var(--blue-800) 0%, var(--blue-700) 55%, #1C3AC4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  /* PENTING: jangan pakai overflow:hidden di sini — dulu itu memotong teks
     panel pada layar pendek. Pemotongan hanya dilakukan oleh .login__deco. */
}
/* Latar panel kiri halaman masuk = FOTO YANG SAMA dengan hero landing page
   (assets/img/hero-bg.jpg), supaya kedua halaman terasa satu keluarga.
   Fotonya sudah punya penurunan sorotan + penggelapan ke arah kiri dari berkasnya,
   jadi overlay di sini cukup untuk keseragaman warna dan transisi.
   Dekorasi dikurung di elemen terpisah supaya tidak menutupi/memotong teks. */
.login__deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login__deco::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("img/hero-bg.jpg");
  background-size: cover;
  background-position: 72% 40%;
}
.login__deco::after {
  content: "";
  position: absolute;
  inset: 0;
  /* lapisan senada dengan .hero__scrim di landing page */
  background:
    linear-gradient(150deg,
      rgba(6, 14, 58, .82) 0%,
      rgba(8, 20, 78, .64) 42%,
      rgba(11, 30, 104, .48) 72%,
      rgba(14, 38, 126, .42) 100%),
    radial-gradient(120% 62% at 78% 4%,
      rgba(64, 104, 255, .26) 0%,
      rgba(27, 52, 200, 0) 66%),
    radial-gradient(90% 70% at 78% 100%,
      rgba(224, 31, 38, .18) 0%,
      rgba(27, 52, 200, 0) 62%);
}
.login__aside-ink { position: relative; z-index: 2; width: 100%; max-width: 470px; }
.login__brand { display: inline-flex; margin-bottom: 26px; }
.login__title { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem); margin-bottom: 14px; }
.login__lead { color: #CBD7FF; font-size: 1rem; margin-bottom: 26px; }
.login__points { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 16px; }
.login__points li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 13px; align-items: start; }
.login__points .ic {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  fill: #fff;
}
.login__points strong { display: block; font-size: .95rem; }
.login__points em { font-style: normal; color: #B9C7FF; font-size: .86rem; }
.login__foot { color: var(--blue-300); font-size: .82rem; margin: 0; }

.login__main {
  display: grid;
  place-items: center;
  padding: 44px 26px;
  background: var(--tint);
}
.login__card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 24px;
  padding: 34px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.login__logo-sm { display: none; margin-bottom: 20px; }
.login__cols { display: grid; gap: 26px; align-items: start; }
.login__col { min-width: 0; }
.login__card--wide { max-width: 820px; }

@media (min-width: 1180px) {
  /* formulir di kiri, akun demo di kanan */
  .login__card--wide .login__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login__card--wide .demo {
    margin-top: 0;
    padding: 4px 0 0 26px;
    border-top: 0;
    border-left: 1px dashed var(--line);
    height: 100%;
  }
  .login__card--wide .demo__btn { padding: 10px 12px; }
}
.login__eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; color: var(--blue-600); margin: 0 0 8px; }
.login__card h2 { font-size: 1.6rem; }
.login__form { display: grid; gap: 16px; margin-top: 22px; }
.login__links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; font-size: .86rem; color: var(--blue-700); font-weight: 600; }
.login__links a:hover { text-decoration: underline; }
.login__help {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}
.login__help .ic { width: 34px; height: 34px; padding: 8px; border-radius: 11px; background: #E6F7EE; fill: #1FA855; }
.login__help a { color: var(--blue-700); font-weight: 700; }

.auth-simple {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 44px 20px;
  background:
    radial-gradient(120% 90% at 80% 5%, rgba(44, 75, 224, .55), rgba(8, 21, 81, 0) 60%),
    linear-gradient(150deg, var(--blue-800), var(--blue-900));
}
.auth-card {
  width: 100%;
  max-width: 470px;
  background: #fff;
  border-radius: 24px;
  padding: 34px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-card__brand { display: inline-flex; margin-bottom: 22px; }
.auth-card__brand .lockup__word { color: var(--blue-700); }
.auth-card h1 { font-size: 1.55rem; margin-bottom: 12px; }
.auth-card .login__links { margin-top: 20px; justify-content: flex-start; }

/* alur pesan air: tab harga & banner */
.notice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #FFF8E8;
  border: 1px solid #F4E3BE;
  color: #7A5800;
  font-size: .88rem;
  margin-bottom: 16px;
}
.notice .ic { fill: #C77700; width: 20px; height: 20px; margin-top: 2px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h2 { font-size: 1.2rem; }
.section-title a { font-size: .86rem; font-weight: 700; color: var(--blue-700); }

.quick-reorder { display: grid; gap: 10px; }
.quick-reorder__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: .88rem;
}

@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login__aside { padding: 28px 22px 30px; align-items: flex-start; }
  .login__deco::before { background-position: 78% 34%; }
  .login__points { display: none; }
  .login__brand { display: none; }        /* logo sudah ada di dalam kartu */
  .login__title { font-size: clamp(1.5rem, 1.1rem + 2.4vw, 2.1rem); margin-bottom: 8px; }
  .login__lead { font-size: .93rem; margin-bottom: 0; }
  .login__foot { display: none; }
  .login__main { padding: 22px 16px 34px; align-items: start; }
  .login__card { border-radius: 20px; padding: 24px 20px; }
  .login__logo-sm { display: block; }
  .login__logo-sm .lockup__word { color: var(--blue-700); }
}

/* ==================================================== PANEL DEMO (login) */
.demo {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.demo__head { display: grid; gap: 6px; margin-bottom: 16px; }
.demo__badge {
  justify-self: start;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8A5A00;
  background: #FFF4D6;
  border: 1px solid #F2DFAE;
  border-radius: 999px;
  padding: 4px 10px;
}
.demo__head p { font-size: .84rem; color: var(--muted); margin: 0; }
.demo__label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 8px;
}
.demo__grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo__grid form { display: contents; }

.demo__btn {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.4px solid var(--blue-100);
  background: linear-gradient(180deg, #F7FAFF, #EDF3FF);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.demo__btn:hover {
  transform: translateY(-2px);
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 14px 26px -18px rgba(27, 52, 200, .8);
}
.demo__btn--staff { background: linear-gradient(180deg, #F4F7FF, #E7EDFF); }
.demo__btn-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.demo__btn-top strong { font-size: .9rem; font-weight: 700; color: var(--ink); }
.demo__btn-top .tag { font-size: .66rem; padding: 3px 8px; }
.demo__btn-sub { font-size: .76rem; color: var(--muted); }
.demo__note {
  margin: 16px 0 0;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.6;
}
.demo__note code {
  font-size: .72rem;
  background: var(--sky);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--blue-700);
}

@media (min-width: 520px) {
  /* panel demo dipadatkan supaya halaman tidak terlalu panjang */
  .demo__head { margin-bottom: 12px; }
  .demo__grid { gap: 8px; }
  .demo__btn { padding: 10px 12px; }
  .demo__btn-top strong { font-size: .85rem; }
  .demo__btn-sub { font-size: .72rem; }
  .demo__label { margin: 12px 0 6px; }
  .demo__note { font-size: .73rem; margin-top: 14px; }
}

@media (max-width: 519px) {
  .demo__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================ LOGO (berkas gambar, bersama) */
/* Dipakai juga oleh portal agen & CRM. Ukuran lewat tinggi agar proporsi
   berkas logo apa pun tetap benar. Logo TIDAK diubah warnanya — di latar gelap
   diberi alas putih (.logo-chip). */
.portal .logo, .logo { display: block; height: auto; width: auto; max-width: 100%; }
/* Logo berwarna (biru + merah) di atas latar gelap WAJIB diberi alas putih —
   tanpa ini logo biru tenggelam di panel biru (pernah terjadi: chip transparan
   karena portal.css tidak memuat aturan latar dari style.css). */
.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 12px 26px -18px rgba(4, 10, 42, .75);
}
.appbar__brand { padding: 2px 0; }
.appbar__brand .logo { height: 40px; max-width: 150px; object-fit: contain; }
.appbar__brand .logo-chip { padding: 6px 10px; border-radius: 11px; }
.sidebar__brand .logo { height: 44px; max-width: 158px; object-fit: contain; }
.sidebar__brand .logo-chip { padding: 8px 12px; border-radius: 13px; }
.login__brand .logo { height: 56px; max-width: 200px; object-fit: contain; }
.login__brand .logo-chip { padding: 10px 14px; border-radius: 15px; }
.login__logo-sm .logo { height: 46px; max-width: 168px; object-fit: contain; }
.auth-card__brand .logo { height: 52px; max-width: 190px; object-fit: contain; }

@media (max-width: 900px) {
  .login__brand .logo { height: 46px; max-width: 168px; }
}
