:root {
  --blue: #1a73e8;
  --blue-dark: #1765cc;
  --ink: #202124;
  --ink-2: #5f6368;
  --line: #dadce0;
  --green: #188038;
  --red: #d93025;
  --amber: #e8710a;
  --radius: 16px;
  --ease: cubic-bezier(.22,.9,.28,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive;
  font-weight: 400;
  color: var(--ink);
  background: linear-gradient(135deg, #e9f0fd 0%, #f7f9fe 45%, #fdf1ec 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- animated glass background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; }
.b1 { width: 480px; height: 480px; background: #bcd6ff; top: -130px; left: -130px; animation: drift1 22s ease-in-out infinite alternate; }
.b2 { width: 430px; height: 430px; background: #c2f0d4; top: 32%; right: -150px; animation: drift2 27s ease-in-out infinite alternate; }
.b3 { width: 380px; height: 380px; background: #ffd8bd; bottom: -150px; left: 28%; animation: drift1 32s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(70px,45px) scale(1.14); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1.06); } to { transform: translate(-75px,-35px) scale(.94); } }

/* ---------- glass topbar ---------- */
.topbar {
  background: rgba(255,255,255,.68);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 4px 24px rgba(60,64,67,.10);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.logo { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 3px 8px rgba(26,115,232,.35)); transition: transform .3s var(--ease); }
.logo:hover { transform: rotate(-8deg) scale(1.06); }
.brand { font-size: 22px; font-weight: 700; letter-spacing: .2px; font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive; }
.brand small { display: block; font-size: 12px; color: var(--ink-2); font-weight: 500; font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive;
  border: 1px solid rgba(218,220,224,.9);
  background: rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--blue);
  font-weight: 500; font-size: 14px;
  padding: 9px 20px; border-radius: 20px; cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), background .22s;
  will-change: transform;
}
.btn:hover:not(:disabled) { background: #f0f6ff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26,115,232,.25); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); box-shadow: 0 2px 6px rgba(26,115,232,.2); }
.btn.primary { background: var(--blue); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(26,115,232,.35); }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 8px 20px rgba(26,115,232,.4); }
.btn.primary:disabled { background: #a8c7fa; border-color: #a8c7fa; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.account-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1a73e8; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 15px;
  box-shadow: 0 3px 10px rgba(26,115,232,.35);
}

main { max-width: 980px; margin: 0 auto; padding: 28px 20px 90px; }

/* ---------- glass stepper ---------- */
.stepper {
  display: flex; gap: 4px; margin-bottom: 26px;
  background: rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 8px 28px rgba(31,38,135,.10), inset 0 1px 0 rgba(255,255,255,.6);
  border-radius: var(--radius); padding: 14px 18px;
  overflow-x: auto;
  animation: cardIn .55s var(--ease) both;
}
.step {
  flex: 1; min-width: 120px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--ink-2); position: relative;
  padding-top: 28px; cursor: pointer; border: none; background: none; font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive;
  transition: color .25s;
}
.step .dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(232,234,237,.9); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  transition: all .3s var(--ease);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.step:hover .dot { transform: translateX(-50%) scale(1.12); }
.step.active { color: var(--blue); font-weight: 500; }
.step.active .dot {
  background: var(--blue); color: #fff;
  box-shadow: 0 4px 12px rgba(26,115,232,.45);
  transform: translateX(-50%) scale(1.1);
}
.step.done .dot { background: var(--green); color: #fff; }

/* ---------- glass cards ---------- */
.card {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(31,38,135,.10), inset 0 1px 0 rgba(255,255,255,.65);
  padding: 26px; margin-bottom: 18px;
  animation: cardIn .55s var(--ease) both;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.card:hover { box-shadow: 0 12px 40px rgba(31,38,135,.14), inset 0 1px 0 rgba(255,255,255,.65); }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.99); } to { opacity: 1; transform: none; } }
.card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive; }
.card p.desc { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }

/* ---------- fields ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; color: var(--ink); }
.field input[type=text], .field input[type=email], .field textarea, .field select {
  width: 100%; font-family: inherit; font-size: 14px;
  border: 1px solid rgba(218,220,224,.9); border-radius: 10px;
  padding: 11px 13px; color: var(--ink);
  background: rgba(255,255,255,.85);
  transition: border-color .2s, box-shadow .25s var(--ease), transform .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.16);
  transform: translateY(-1px);
  background: #fff;
}
.field textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
.hint { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }

/* ---------- drop zones ---------- */
.drop {
  border: 2px dashed rgba(26,115,232,.35); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer;
  background: rgba(255,255,255,.45);
  transition: all .28s var(--ease);
}
.drop:hover { border-color: var(--blue); background: rgba(240,246,255,.7); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(26,115,232,.14); }
.drop.over { border-color: var(--blue); background: rgba(232,240,254,.85); transform: scale(1.015); box-shadow: 0 10px 26px rgba(26,115,232,.2); }
.drop .big { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.drop .sub { font-size: 13px; color: var(--ink-2); }
.file-ok {
  display: flex; align-items: center; gap: 12px;
  background: rgba(230,244,234,.85); border: 1px solid rgba(206,234,214,.9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 10px; padding: 12px 16px; font-size: 14px;
  animation: cardIn .4s var(--ease) both;
}
.file-ok .x { margin-left: auto; cursor: pointer; color: var(--ink-2); border: none; background: none; font-size: 16px; transition: transform .2s; }
.file-ok .x:hover { transform: scale(1.25); color: var(--red); }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
table.data th, table.data td { border: 1px solid rgba(218,220,224,.7); padding: 8px 10px; text-align: left; }
table.data th { background: rgba(241,243,244,.8); font-weight: 500; }
table.data tbody tr { transition: background .2s; }
table.data tbody tr:hover { background: rgba(232,240,254,.5); }
.table-wrap { overflow-x: auto; border-radius: 10px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip-btn {
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive; font-size: 13px; font-weight: 600; padding: 7px 14px;
  border: 1px solid rgba(255,255,255,.8); border-radius: 18px;
  background: rgba(255,255,255,.65);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(60,64,67,.08);
  cursor: pointer; color: var(--ink);
  transition: all .22s var(--ease);
}
.chip-btn:hover { background: rgba(232,240,254,.9); border-color: var(--blue); color: var(--blue); transform: scale(1.07) translateY(-1px); box-shadow: 0 5px 14px rgba(26,115,232,.22); }
.chip-btn:active { transform: scale(.96); }

/* ---------- mail preview ---------- */
.mail-preview {
  border: 1px solid rgba(255,255,255,.8); border-radius: 12px; overflow: hidden; margin-top: 14px;
  background: rgba(255,255,255,.6);
  box-shadow: 0 6px 20px rgba(31,38,135,.08);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.mail-preview:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(31,38,135,.12); }
.mail-preview .mp-head { background: rgba(241,243,244,.7); padding: 12px 16px; border-bottom: 1px solid rgba(218,220,224,.6); font-size: 14px; }
.mail-preview .mp-head b { font-weight: 500; }
.mail-preview .mp-body { padding: 18px; font-family: 'Times New Roman', Times, serif; font-size: 16px; line-height: 1.7; white-space: pre-wrap; }
.mail-preview .mp-attach {
  margin: 0 18px 18px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(218,220,224,.8); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink-2);
  background: rgba(255,255,255,.7);
}
.pager { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-size: 14px; }

/* ---------- progress & stats ---------- */
.progress { height: 12px; background: rgba(232,234,237,.7); border-radius: 8px; overflow: hidden; margin: 14px 0; box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.progress > div {
  height: 100%; width: 0%;
  background: var(--blue);
  border-radius: 8px;
  transition: width .4s var(--ease);
  animation: progSlide 2.2s linear infinite;
  position: relative; overflow: hidden;
}
.progress > div::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shimmer 1.6s var(--ease) infinite;
}
@keyframes progSlide { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.stats { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.stat {
  background: rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.8); border-radius: 12px;
  box-shadow: 0 4px 16px rgba(31,38,135,.07);
  padding: 12px 18px; min-width: 130px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(31,38,135,.12); }
.stat .n { font-size: 28px; font-weight: 700; font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive; }
.stat .l { font-size: 12px; color: var(--ink-2); }
.stat.ok .n { color: var(--green); } .stat.fail .n { color: var(--red); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 14px; transition: all .25s var(--ease); font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive; }
.pill.pending { background: rgba(241,243,244,.9); color: var(--ink-2); }
.pill.sending { background: #fef7e0; color: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
.pill.sent { background: rgba(230,244,234,.95); color: var(--green); }
.pill.failed { background: #fce8e6; color: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.quota {
  font-size: 13px; color: var(--ink-2);
  background: rgba(254,247,224,.75);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(253,226,147,.8); border-radius: 10px;
  padding: 10px 14px; margin-top: 12px;
}
.nav-row { display: flex; gap: 12px; margin-top: 20px; }
.hidden { display: none !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } .stepper { padding: 10px; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(50,50,50,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font-size: 14px;
  padding: 13px 24px; border-radius: 14px; z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.14);
  max-width: 90vw;
  animation: toastIn .38s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

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

textarea#body { font-family: 'Times New Roman', Times, serif; font-size: 16px; line-height: 1.7; }

/* ---------- tabs & riwayat ---------- */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; animation: cardIn .55s var(--ease) both; }
.tab {
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive;
  font-size: 15px; font-weight: 700; padding: 11px 24px; border-radius: 26px;
  border: 1px solid rgba(255,255,255,.85); cursor: pointer; color: var(--ink-2);
  background: rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(31,38,135,.08);
  transition: all .25s var(--ease);
}
.tab:hover:not(.active) { transform: translateY(-2px); color: var(--blue); }
.tab.active { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(26,115,232,.4); }
.hist-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; margin-bottom: 10px; cursor: pointer;
  border: 1px solid rgba(218,220,224,.7); border-radius: 14px;
  background: rgba(255,255,255,.65);
  transition: all .22s var(--ease);
}
.hist-item:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31,38,135,.13); border-color: var(--blue); }
.hist-item .grow { flex: 1; min-width: 0; }
.hist-item .t { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .s { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.hist-item .go { color: var(--ink-2); font-size: 18px; }
#fbConfig { min-height: 130px; }

/* ---------- pemetaan kolom & laporan ---------- */
#mapGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.map-row { background: rgba(255,255,255,.6); border: 1px solid rgba(218,220,224,.7); border-radius: 10px; padding: 10px 12px; }
.map-row label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--blue); }
.map-row select { width: 100%; font-family: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; }
.health-ok { background: rgba(230,244,234,.9); border: 1px solid #ceead6; border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 8px; }
.health-warn { background: rgba(254,247,224,.92); border: 1px solid #fde293; border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 8px; }
.health-bad { background: #fce8e6; border: 1px solid #f5c6c2; border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 8px; }
.follow-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid rgba(218,220,224,.7); border-radius: 10px; margin-bottom: 8px; background: rgba(255,255,255,.6); font-size: 13.5px; }
.follow-item .grow { flex: 1; }
