/* =========================
   Chart box (wrapper)
   ========================= */
.chart-box{
  position: relative;
  width: 100%;
  height: 460px;
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  border: 1px dashed rgba(16,24,40,.16);

  padding: 12px;
  overflow: visible;              /* ✅ label tidak kepotong */
}

/* area dalam untuk canvas */
.chart-inner{
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

/* Canvas mengikuti inner */
.chart-inner canvas{
  width: 100% !important;
  height: 100% !important;
}

/* ✅ Mode landscape */
.chart-box.landscape{ height: 420px; }

/* ✅ Mode tall */
.chart-box.tall{ height: 520px; }

/* ✅ Extra padding kanan untuk chart horizontal (angka di ujung) */
.chart-box.pad-right{ padding-right: 44px; }

/* ✅ Store Rank: bisa tampil ALL store tanpa bikin halaman jadi super panjang */
.chart-box.store-rank{
  height: 520px;          /* lebih besar supaya nyaman */
  overflow-y: auto;       /* scroll untuk ALL store */
  overflow-x: hidden;
}

@media (max-width: 768px){
  .chart-box{ height: 320px; padding: 10px; }
  .chart-box.landscape{ height: 320px; }
  .chart-box.tall{ height: 460px; }
  .chart-box.pad-right{ padding-right: 34px; }
  .chart-box.store-rank{ height: 420px; }
}

/* =========================
   Net ping indicator
   ========================= */
.net-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.net-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(16,185,129,1);
}
#netBadge.checking .net-dot{
  background: rgba(245,158,11,1);
  animation: netPulse 1.2s ease-in-out infinite;
}
#netBadge.offline .net-dot{
  background: rgba(220,38,38,1);
  animation: netPulse 1.1s ease-in-out infinite;
}
@keyframes netPulse{
  0%{ box-shadow: 0 0 0 0 rgba(220,38,38,.45); }
  70%{ box-shadow: 0 0 0 10px rgba(220,38,38,0); }
  100%{ box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

.net-toast{
  position: fixed;
  top: 78px;
  right: 16px;
  z-index: 2100;
}
.net-toast-inner{
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(16,24,40,.12);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 240px;
}

/* =========================
   KPI cards
   ========================= */
.kpi{
  border: 1px solid rgba(16,24,40,.08) !important;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(16,24,40,.06);
}

/* =========================
   Busy overlay (popup animasi)
   ========================= */
body.busy-lock{ overflow: hidden; }

.busy-overlay{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15,23,42,.35);
  backdrop-filter: blur(6px);
}

.busy-card{
  width: min(560px, calc(100vw - 36px));
  background: rgba(255,255,255,.94);
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(16,24,40,.12);
  box-shadow: 0 18px 45px rgba(16,24,40,.20);
  transform-origin: center;
  animation: busyPop .22s ease-out;
}

@keyframes busyPop{
  from{ transform: translateY(10px) scale(.985); opacity: 0; }
  to{ transform: translateY(0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce){
  .busy-card{ animation: none; }
}


/* =========================
   App UI (polish)
   ========================= */
.app-topbar{
  backdrop-filter: blur(10px);
}

/* =========================
   Tabs (FIX: tap/click di mobile + tidak ketutup chart)
   ========================= */
.app-tabs{
  position: relative;
  z-index: 20; /* pastikan tab bisa di-tap (tidak ketutup elemen lain) */
}
@media (max-width: 768px){
  .app-tabs{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 6px;
  }
  .app-tabs .nav-link{ white-space: nowrap; }
  .app-tabs::-webkit-scrollbar{ height: 6px; }
}


.app-card{
  border-radius: 14px;
}

.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13,110,253,.12);
  border: 1px solid rgba(13,110,253,.25);
  color: #0d6efd;
}

.brand-mark.brand-logo{
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
}
.brand-logo-img{
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}


.app-chip{
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.12);
  color: #0f172a;
}


/* =========================
   Numeric text weights
   ========================= */
#kpiTotalAmount,#kpiTotalRounding,#kpiTotalOrders,#kpiAvgOrderValue,#kpiBestStore,#kpiBestStoreValue,#kpiBestDay,#kpiBestDayValue{font-weight:400 !important;}


/* =========================
   AUTH (LOGIN) — Professional
   ========================= */
.auth-bg{
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(13,110,253,.18), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(32,201,151,.14), transparent 60%),
    radial-gradient(800px 520px at 50% 100%, rgba(255,193,7,.14), transparent 55%),
    #f6f8fb;
}

.auth-wrap{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 12px;
}

.auth-card{
  width: min(980px, 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
}

.auth-side{
  height: 100%;
  background:
    radial-gradient(800px 420px at 10% 10%, rgba(255,255,255,.22), transparent 50%),
    linear-gradient(135deg, #0d6efd, #198754);
  color: #fff;
}

.auth-side-inner{
  height: 100%;
  padding: 34px 34px 28px 34px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-title{
  font-size: 30px;
  letter-spacing: .5px;
  margin: 0;
}

.auth-subtitle{
  opacity: .9;
  font-size: 14px;
}

.auth-logo{
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
}
.auth-logo .brand-logo-img{
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.auth-bullets{ font-size: 14px; }
.auth-bullet{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  margin-bottom: 10px;
}
.auth-bullet .dot{
  width:10px; height:10px; border-radius:999px;
  background: rgba(255,255,255,.9);
  display:inline-block;
}

.auth-main{
  padding: 32px 28px;
}
@media (min-width: 992px){
  .auth-main{ padding: 40px 40px; }
}
.auth-heading .h4{ margin:0; }


/* =========================
   Watermark (global)
   ========================= */
.app-watermark{
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 1080;
  font-size: 12px;
  letter-spacing: .25px;
  color: rgba(15,23,42,.42);
  opacity: .22;            /* lebih transparan */
  background: transparent; /* tanpa pill */
  border: 0;
  padding: 0;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255,255,255,.65);
}

/* Login watermark background (halus) */
.login-bg-wm{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.login-bg-wm .wm-wrap{
  transform: rotate(-12deg);
  text-align: center;
  user-select: none;
}

.login-bg-wm .wm-title{
  font-weight: 800;
  letter-spacing: .08em;
  font-size: clamp(54px, 7.5vw, 140px);
  color: rgba(15,23,42,.9);
  opacity: .045;
  line-height: 1;
  text-transform: uppercase;
}

.login-bg-wm .wm-sub{
  margin-top: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  font-size: clamp(14px, 1.8vw, 26px);
  color: rgba(15,23,42,.9);
  opacity: .05;
}

/* Login: single column */
.auth-card-single{
  width: min(520px, 92vw);
}


/* === PRO UI PATCH === */

.pro-nav{ backdrop-filter: blur(8px); }
.pro-hero{
  background:
    radial-gradient(1200px 380px at 20% -10%, rgba(220,53,69,.10), transparent 60%),
    radial-gradient(900px 320px at 90% 0%, rgba(13,110,253,.08), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.35));
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.pro-card{ border-radius: 18px; overflow: hidden; }
.pro-card-header{ padding: 1rem 1.25rem; }
.pro-divider{ height: 1px; background: rgba(0,0,0,.07); margin: .25rem 0; }
.pro-pill{ border-radius: 999px; font-weight: 600; }
.pro-badge{ border-radius: 999px; padding: .45rem .7rem; font-weight: 700; letter-spacing: .02em; }
.pro-alert{ border-radius: 14px; }
.pro-kv{
  background: rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  padding: .9rem 1rem;
}
.btn, .form-control, .form-select{ border-radius: 12px; }
.dropdown-menu{ border-radius: 14px; }
.table{ --bs-table-bg: transparent; }
