/* =========================================================
   🌑 DARK ELEGANT THEME (Improved Clean Version)
   ========================================================= */

/* === Global === */

#loadingOverlay {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#loadingOverlay.show {
  opacity: 1;
  visibility: visible;
}
body {
  background-color: #E9E8E3;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #2E2F2C;
  margin: 0;
}

.main-content {
  background: linear-gradient(
    180deg,
    #F2F7F8,
    #E9F1F3
  );
  min-height: 100vh;
}


.btn-success {
  background-color: #e34100 !important;
  border-color: #e34100 !important;
  color: #fff;
  font-weight: 500;
  border-radius: 999px; /* pill */
  transition: all 0.2s ease-in-out;
}

#wrapper {
  min-height: 100vh;
  display: flex;
}

#sidebar {
  width: 260px;
  min-height: 100vh;
  position: relative;
  color: #EAF7FA;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* 🔒 BACKGROUND DIKUNCI */
#sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,132,150,1),
    rgb(0, 150, 136)
  );
  z-index: 0;
}

/* isi sidebar di atas background */
#sidebar > * {
  position: relative;
  z-index: 1;
}

#sidebar {
  transition: margin-left 0.25s ease;
}


.sidebar-header {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}


.sidebar-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;

  background: #ffffff;
  padding: 6px;
  border-radius: 10px;

  box-shadow: 0 6px 14px rgba(0,0,0,0.18);

  animation: spinSlow 18s linear infinite;
}

/* animasi */
@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}





#sidebar.collapsed {
  margin-left: -260px;
}



#sidebar .components {
  padding-left: 0;
  margin-top: 1rem;
}

#sidebar .components li {
  list-style: none;
  margin-bottom: 6px;
}

/* Menu */
#sidebar .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255,255,255,.85);
  transition: all .2s ease;
}

#sidebar .menu-item:hover {
  background: rgba(255,255,255,.18);
  color: #ffffff;
}

#sidebar .menu-item.active {
  background: rgba(255,255,255,0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}


/* #sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.12), transparent 45%);
  opacity: 0.6;
  pointer-events: none;
} */




#sidebar .active i,
#sidebar .active span {
  color: #ffffff;
  font-weight: 600;
}

/* Submenu */
.submenu > a.menu-item {
  justify-content: space-between;
  padding-right: 20px;
}

.submenu .dropdown-toggle::after {
  display: none !important;
}

.submenu > a.menu-item:hover {
  background-color: #2C3430;
  color: #A6E3B8;
}

.submenu ul {
  margin-top: 4px;
  padding-left: 10px;
}

.submenu ul li {
  list-style: none;
}

.submenu ul li a {
  display: block;
  font-size: 0.93rem;
  color: #A5A8A3;
  padding: 8px 16px 8px 32px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.submenu ul li a:hover {
  background-color: #2C3430;
  color: #A6E3B8;
}

.submenu ul li a.active {
  background-color: #4CAF50;
  color: #FFFFFF;
}

.submenu .chevron {
  transition: transform 0.25s ease;
  font-size: 0.9rem;
  color: #888;
}

.submenu .menu-item[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
  color: #A6E3B8;
}

/* =========================================================
   === Supplier & Product Dropdown Fix (existing)
   ========================================================= */
select.form-select,
select {
  position: relative !important;
  z-index: 20 !important;
}

.produkSelect {
  width: 100%;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999 !important;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.produkSelect.show {
  display: block;
  z-index: 9999 !important;
}

.suggestionList {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestionList .list-group-item {
  cursor: pointer;
  font-size: 0.9rem;
}

.suggestionList .list-group-item:hover {
  background-color: #f1f1f1;
}

/* =========================================================
   === 📌 FIX BARU: Dropdown Satuan Tidak Melebar
   ========================================================= */
#produkTable td,
#produkBody td {
  position: relative;
}

.refund-upload{
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: all 0.35s ease;
}

.refund-upload.show{
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
}

/* Dropdown satuan */
.unitSelect {
  position: absolute;
  top: 100%;
  left: 0;
  width: 120px !important;
  max-height: 200px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.unitSelect.show {
  display: block;
}

.unitSelect .list-group-item {
  padding: 6px 12px;
  cursor: pointer;
}

.unitSelect .list-group-item:hover {
  background: #f1f1f1;
}

.satuanInput {
  width: 100%;
  min-width: 60px;
  text-align: center;
}

/* === Table Fix (agar dropdown tidak terpotong) === */
.table-responsive,
.card,
.container {
  overflow: visible !important;
}

/* === Buttons === */

/* === Buttons === */
.btn-primary {
  height: 42px;
  border: none !important;
  border-radius: 14px;
  font-weight: 600;
  color: #ffffff !important;

  /* 🔵 TEAL (turunan dari rgba(0,150,136,0.35)) */
  background: linear-gradient(
    180deg,
    rgb(0, 150, 136),
    rgb(0, 121, 107)
  ) !important;

  box-shadow: 0 5px 5px rgba(0, 150, 136, 0.35);
  transition: transform .08s ease, filter .12s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-aksi {
  height: 38px;
  padding: 0 14px;

  border: none !important;
  border-radius: 10px;

  font-weight: 600;
  font-size: 14px;
  color: #fff !important;

  background: linear-gradient(
    180deg,
    #5c6bc0,
    #3f51b5
  ) !important;

  box-shadow: 0 3px 8px rgba(63, 81, 181, 0.25);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  transition: all .18s ease;
}

.btn-aksi:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn-aksi:active {
  transform: translateY(0);
}

/* hover effect */
.btn-aksi:hover {
  filter: brightness(1.05);
}

/* click effect */
.btn-aksi:active {
  transform: scale(0.98);
}



/* TomSelect tetap pendek & rapi */
.ts-dropdown {
  max-height: 180px !important;
  overflow-y: auto;
  border-radius: 8px;
}

/* Input search nyatu */
.ts-control {
  min-height: 32px;
  padding: 4px 8px;
}

.btn-aksi:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dropdown-item.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* === Nav Tabs === */
.nav-tabs .nav-link {
  color: #2C3430;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-tabs .nav-link:hover {
  color: #78b30b;
  background-color: rgba(255, 255, 255, 0.05);
  border-bottom: 2px solid #78b30b;
}

.nav-tabs .nav-link.active {
  color: #78b30b;
  background-color: rgba(120, 179, 11, 0.1);
  border-bottom: 2px solid #78b30b;
}

/* === Cards === */
.card {
  border: none;
  border-radius: 20px;
  background: #ffffff;
  box-shadow:
    0 10px 30px rgba(18, 26, 44, 0.08);
}

.card:hover {
  transform: translateY(-4px);
  transition: 0.2s ease;
}

.topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* === Table === */
.table {
  color: #2E2F2C;
}

.table thead {
  background-color: #F3F3F1;
}

.table tbody tr:hover {
  background-color: #F0F0EE;
  transition: background 0.3s ease;
}

.hidden {
  display: none !important;
}


.input-readonly-yellow[readonly] {
  background-color: #eeeee4 !important; /* kuning telur lembut */
  cursor: not-allowed;
}

#tabelCustomer td:nth-child(3) {
  max-width: 240px;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1E2320;
}

::-webkit-scrollbar-thumb {
  background: #2C3430;
  border-radius: 8px;
}

.col-price,
.col-subtotal {
  display: none !important;
}

/* ===== PAGE BASE ===== */
.auth-login-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #e0f7fa, #b2ebf2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  position: relative;
}

/* ===== BACKGROUND AIR ===== */
.fish-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== WAVES ===== */
.wave {
  position: absolute;
  width: 220%;
  height: 240px;
  background: rgba(255,255,255,0.18);
  border-radius: 45%;
  animation: waveMove 24s ease-in-out infinite alternate;
}


.wave1 {
  bottom: -60px;
  animation-duration: 22s;
}

.wave2 {
  bottom: -90px;
  opacity: 0.4;
  animation-duration: 30s;
}

/* ===== IKAN ===== */
.fish {
  position: absolute;
  font-size: 42px;
  color: rgba(0, 150, 136, 0.35);
  animation: swim 20s linear infinite;
}

.f1 { top: 25%; left: -60px; animation-delay: 0s; }
.f2 { top: 45%; left: -80px; font-size: 34px; animation-delay: 5s; }
.f3 { top: 65%; left: -100px; font-size: 38px; animation-delay: 10s; }

/* ===== BUBBLE ===== */
.bubble {
  position: absolute;
  bottom: -40px;
  width: 14px;
  height: 14px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: bubbleUp 10s infinite ease-in;
}

.b1 { left: 20%; animation-delay: 0s; }
.b2 { left: 40%; animation-delay: 3s; width: 10px; height: 10px; }
.b3 { left: 60%; animation-delay: 6s; }
.b4 { left: 80%; animation-delay: 1.5s; width: 8px; height: 8px; }

/* ===== LOGIN CARD ===== */
.login-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* ===== ANIMATIONS ===== */
@keyframes swim {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

@keyframes bubbleUp {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.8; }
  100% { transform: translateY(-110vh); opacity: 0; }
}

@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}



/* ===== PRINT MODE ===== */
.print-only {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  #printAreaDO,
  #printAreaDO * {
    visibility: visible;
  }

  #printAreaDO {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    font-size: 12px;
  }

  .btn,
  button {
    display: none !important;
  }
}

/* ===== PRINT STYLE ===== */
.print-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.print-logo {
  width: 80px;
}

.print-header-center {
  text-align: center;
}

.print-header-right {
  text-align: right;
}

.print-info {
  width: 100%;
  margin-bottom: 12px;
}

.print-info td {
  padding: 4px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
}

.print-table th,
.print-table td {
  border: 1px solid #000;
  padding: 6px;
  text-align: center;
}

.print-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}


/* === Responsiveness === */
@media (max-width: 992px) {
  #sidebar {
    position: absolute;
    z-index: 999;
    height: 100%;
  }
}

  /* DO list styling */
#tblDetailSOView tbody tr.do-head-row td {
    vertical-align: top;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .do-badge {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
  }

  .do-meta {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.35;
  }

  .do-items-wrap {
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 10px 12px;
  }

  .do-items-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .do-items-table th, .do-items-table td {
    font-size: 12px;
    padding: 6px 8px;
    vertical-align: top;
  }

  .do-items-table thead th {
    background: rgba(255,255,255,.9);
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  .hidden { display: none !important; }

.customer-autocomplete {
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  overflow: hidden;
}

.customer-autocomplete .list-group-item {
  border: 0;
  background: #fff;
}

.customer-autocomplete .list-group-item:hover {
  background: rgba(0,0,0,.04);
}


/* =========================================================
   MENJALA • LOGIN PAGE THEME
   + animasi background + corak minimalis (dots/lines + blobs)
   ========================================================= */

:root{
  --mj-teal:#07A0C3;
  --mj-orange:#E34300;
  --mj-navy:#14294F;
  --mj-bg1:#F8F5EF;
  --mj-bg2:#F3EEE7;
}

/* Scope khusus login */
body.auth-login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.35), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.25), transparent 45%),
    linear-gradient(180deg, #006d77, #83c5be);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}


/* ===== Layer 1: BG Image ===== */
body.auth-login-page::before,
body.auth-login-page::after {
  display: none !important;
}

/* ===== Card login ===== */
body.auth-login-page .login-card{
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 2rem 2rem 1.5rem;

  position: relative;
  z-index: 10;

  background: rgba(255,255,255,.86);
  border: 1px solid rgba(20,41,79,.10);
  box-shadow: 0 28px 70px rgba(18, 26, 44, .18);
  backdrop-filter: blur(10px);

  animation: menjalaFadeIn .55s ease-in-out;
}

/* brand */
body.auth-login-page .brand{
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

body.auth-login-page .brand-logo-wide{
  width: min(360px, 92%);
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 22px rgba(18,26,44,.18));
}

body.auth-login-page .brand-sub{
  margin: -4px 0 0;
  font-size: 13px;
  color: rgba(20,41,79,.60);
}

/* label & input */
body.auth-login-page .form-label{
  font-weight: 600;
  font-size: 13px;
  color: rgba(20,41,79,.72);
}

body.auth-login-page .form-control{
  border-radius: 12px;
  padding: 0.78rem 1rem;
  border: 1px solid rgba(20,41,79,.14);
  background: rgba(255,255,255,.78);
  box-shadow: 0 6px 14px rgba(18,26,44,.06);
}

/* eye icon */
body.auth-login-page #togglePassword{
  top: 43px;
  right: 16px;
  cursor: pointer;
  color: rgba(20,41,79,.55);
}

/* button */
body.auth-login-page .btn-login{
  height: 48px;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  color: #fff;

  box-shadow: 0 12px 28px rgba(18,26,44,.12);
  background: linear-gradient(180deg, rgb(7, 157, 195), rgba(0,132,150,1));
  transition: transform .08s ease, filter .12s ease;
}
body.auth-login-page .btn-login:hover{ filter: brightness(1.02); }
body.auth-login-page .btn-login:active{ transform: translateY(1px); }

body.auth-login-page .small-muted{
  color: rgba(20,41,79,.55);
}

/* ===== Animations ===== */
@keyframes menjalaFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes menjalaBgFloat{
  0%   { transform: translateY(-10px) scale(1.02); }
  50%  { transform: translateY(10px)  scale(1.03); }
  100% { transform: translateY(-10px) scale(1.02); }
}

@keyframes menjalaOverlayDrift{
  0%   { transform: translate3d(-10px, 10px, 0); }
  50%  { transform: translate3d(10px, -12px, 0); }
  100% { transform: translate3d(-10px, 10px, 0); }
}

@keyframes menjalaBlobLeft{
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(40px, -20px, 0) scale(1.05); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes menjalaBlobRight{
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-45px, 25px, 0) scale(1.06); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes swimReverse {
  0% { transform: translateX(120vw) scaleX(-1); }
  100% { transform: translateX(-200px) scaleX(-1); }
}

.f4 {
  top: 35%;
  right: -80px;
  font-size: 36px;
  animation: swimReverse 26s linear infinite;
  opacity: .35;
}

/* Mobile */
@media (max-width: 520px){
  body.auth-login-page .login-card{
    padding: 1.5rem 1.25rem 1.2rem;
    border-radius: 18px;
  }
  body.auth-login-page .brand-logo-wide{
    width: min(320px, 92%);
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  body.auth-login-page::before,
  body.auth-login-page::after,
  body.auth-login-page .menjala-blob{
    animation: none !important;
  }
}

/* ===== View Tabs ===== */
.view-tabs{
  display:inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(20,41,79,.10);
  box-shadow: 0 10px 22px rgba(18,26,44,.06);
}

.view-tab{
  border: 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  color: rgba(20,41,79,.70);
  background: transparent;
  transition: transform .08s ease, filter .12s ease, background .12s ease;
}
.view-tab:hover{ filter: brightness(1.02); }
.view-tab:active{ transform: translateY(1px); }

.view-tab.active{
  background: linear-gradient(180deg, rgb(0,150,136), rgb(0,121,107));
  color: #fff;
  box-shadow: 0 10px 20px rgba(0,150,136,.22);
}

/* ===== Chart Cards polish ===== */
.card.chart-card{
  border-radius: 22px;
  border: 1px solid rgba(20,41,79,.10);
  box-shadow: 0 14px 40px rgba(18,26,44,.10);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(0,150,136,.13), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.96), #fff);
}

.card.chart-card-blue{
  background:
    radial-gradient(circle at 18% 12%, rgba(7,160,195,.14), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.96), #fff);
}

.card.chart-card-orange{
  background:
    radial-gradient(circle at 18% 12%, rgba(227,67,0,.14), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.96), #fff);
}

.card.chart-card .chart-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 8px;
}

.card.chart-card .chart-title{
  font-weight: 900;
  color: rgba(20,41,79,.88);
  margin: 0;
  letter-spacing: .2px;
}

.card.chart-card .chart-sub{
  font-size: 12px;
  color: rgba(20,41,79,.55);
  margin: 0;
}

.card.chart-card .chart-body{
  padding: 8px 16px 16px;
  height: 270px;
}
.card.chart-card canvas{
  width: 100% !important;
  height: 100% !important;
}

.chart-pill{
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(20,41,79,.12);
  background: rgba(255,255,255,.72);
  color: rgba(20,41,79,.70);
  font-weight: 900;
  white-space: nowrap;
}

/* ===== KPI ===== */
.chart-kpi{ display:flex; gap:12px; align-items:stretch; }
.kpi-item{
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(20,41,79,.10);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 22px rgba(18,26,44,.06);
}
.kpi-label{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  color: rgba(20,41,79,.55);
  text-transform: uppercase;
}
.kpi-value{
  margin-top: 4px;
  font-size: 16px;
  font-weight: 900;
  color: rgba(20,41,79,.90);
  line-height: 1.15;
}
.kpi-badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
  border: 1px solid rgba(20,41,79,.12);
  background: rgba(255,255,255,.85);
  color: rgba(20,41,79,.75);
  white-space: nowrap;
}
.kpi-badge.up{
  border-color: rgba(0,150,136,.30);
  background: rgba(0,150,136,.10);
  color: rgb(0,150,136);
}
.kpi-badge.down{
  border-color: rgba(227,67,0,.30);
  background: rgba(227,67,0,.10);
  color: rgb(227,67,0);
}

@media (max-width: 768px){
  .card.chart-card .chart-head{ flex-direction: column; }
  .chart-kpi{ width:100%; }
  .kpi-item{ flex:1; min-width: 0; }
}

/* =========================================================
   ✅ DASHBOARD LAYOUT FIX (sidebar aman + anti geser)
   Tempel di PALING BAWAH file CSS
   ========================================================= */

/* cegah horizontal scroll yang bikin sidebar ketarik */
html, body{
  width: 100%;
  overflow-x: hidden;
}

/* wrapper wajib full width */
#wrapper{
  width: 100%;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden; /* kunci */
}

/* sidebar jangan pernah ikut "melar" */
#sidebar{
  flex: 0 0 260px;     /* kunci lebar di flex */
  width: 260px;
  max-width: 260px;
  z-index: 1000;
}

/* area konten: harus boleh menyusut agar tidak mendorong sidebar */
.main-content,
#content{
  flex: 1 1 auto;
  min-width: 0;        /* INI KUNCI utama flex agar chart/card tidak maksa lebar */
  overflow-x: hidden;
  padding: 18px 22px;
}

/* row/col bootstrap kadang bikin overflow: pastikan aman */
.main-content .row,
.main-content .col,
.main-content .container,
.main-content .container-fluid{
  min-width: 0;
}

/* card/chart jangan bikin overflow */
.card,
.chart-card{
  min-width: 0;
}

/* canvas jangan bikin layout melebar */
.chart-body{
  min-width: 0;
  overflow: hidden; /* penting untuk chart */
}

.chart-card canvas,
canvas{
  display: block;
  max-width: 100% !important;
}

/* =========================================================
   ✅ OVERRIDE: overflow visible yg bikin layout gampang melebar
   - kamu sebelumnya set .card/.container overflow: visible !important
   - itu bagus untuk dropdown, tapi jelek untuk chart/dashboard
   - jadi kita batasi: khusus dashboard/chart harus hidden
   ========================================================= */

.dashboard-page .card,
.dashboard-page .chart-card,
.dashboard-page .container:not(.topbar),
.dashboard-page .container-fluid:not(.topbar){
  overflow: hidden !important;
}
.dashboard-page .table-responsive{
  overflow: hidden !important; /* biar chart tidak dorong layout */
}


/* dropdown tetap boleh visible untuk halaman lain
   (aturan lama kamu sudah ada di atas, jadi tidak perlu ditulis ulang di sini) */


/* =========================================================
   ✅ OPTIONAL: Kasih class pada body halaman dashboard:
   <body class="dashboard-page">
   agar override di atas hanya berlaku di dashboard
   ========================================================= */


/* =========================================================
   ✅ RESPONSIVE: sidebar overlay di mobile tetap aman
   ========================================================= */
@media (max-width: 992px){
  #sidebar{
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
  }
  .main-content,
  #content{
    padding: 16px;
  }
}



#tabelJurnal tr td:first-child:not([colspan]) {
  border-right: 2px solid #000;
}

#tabelJurnal tr.row-bottom td:not(:first-child) {
  border-bottom: 2px solid #000;
}

/* ❌ hapus border bawah kalau sebelum total */
#tabelJurnal tr.row-bottom td:not(:first-child) {
  border-bottom: none;
}

#tabelJurnal tr.border-top td {
  border-top: 2px solid #000 !important;
  border-bottom: 2px solid #000 !important;
}

#tabelJurnal tr.row-first td {
  border-top: 0px solid #000 !important;
}

#tabelJurnal tr.row-last td:not(:first-child):not([colspan]) {
  border-bottom: 2px solid #000 !important;
}

#tabelJurnal tr.border-date td {
  border-top: 2px solid #000 !important;
}

#dashViewTabs { 
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

#dashViewTabs .view-tab{
  pointer-events: auto;
}

/* =========================================================
   CSS MENU = ADD USER (FINAL STABLE VERSION)
   ========================================================= */

/* =========================
   PERMISSION CONTAINER
========================= */
#umPermissions {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}

/* =========================
   GROUP & ITEM
========================= */
.permission-group {
  border-left: 4px solid #dee2e6;
  padding-left: 10px;
}

.permission-item {
  background: #fafafa;
  transition: 0.2s;
}

.permission-item:hover {
  background: #f1f3f5;
}

/* =========================
   CRUD CHIP STYLE
========================= */
.permission-crud label {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* =========================
   CHECKBOX VISIBILITY FIX
========================= */
.permission-crud input[type="checkbox"] {
  accent-color: #009688;   /* TEAL */
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* =========================
   ANTI NAVIGASI (TAPI TIDAK MATIKAN INPUT)
========================= */
#umPermissions a {
  pointer-events: none !important; /* matikan link saja */
}

/* =========================
   TOMSELECT FIX (ROLE JUMP)
========================= */
.ts-wrapper,
.ts-control {
  min-height: 38px !important;
}

.ts-wrapper {
  position: relative !important;
}

/* sembunyikan select asli */
#umRoles {
  display: none !important;
}

/* =========================
   CARD HEIGHT FIX
========================= */
.col-lg-6 > .card {
  height: auto !important;
}


/* =========================================================
   ✅ FIX: USER DROPDOWN TOPBAR (ANTI KETUTUP)
   ========================================================= */

/* topbar harus jadi anchor dropdown */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1050; /* di atas card & chart */
  overflow: visible !important;
}

/* dropdown bootstrap */
.topbar .dropdown,
.topbar .dropdown-menu {
  position: relative;
  z-index: 1060;
}

/* dropdown menu harus boleh keluar */
.topbar .dropdown-menu {
  position: absolute;
  z-index: 1070 !important;
}

/* pastikan container topbar tidak memotong */
.topbar,
.topbar * {
  overflow: visible !important;
}





/* =========================================================
   MENJALA ERP UI KIT
   Modern SaaS UI Layer
   Tempel di PALING BAWAH CSS
   ========================================================= */

:root{

  /* ===== BRAND ===== */
  --mj-teal: rgb(0,150,136);
  --mj-teal-dark: rgb(0,121,107);

  /* ===== ACTION ===== */
  --mj-action: #6366f1;
  --mj-action-dark: #4f46e5;

  /* ===== STATUS ===== */
  --mj-success: #22c55e;
  --mj-warning: #f59e0b;
  --mj-danger: #ef4444;
  --mj-info: #06b6d4;

  /* ===== UI ===== */
  --mj-border: rgba(20,41,79,.10);
  --mj-text-soft: rgba(20,41,79,.60);

}


/* =========================================================
   BUTTON SYSTEM
   ========================================================= */

/* PRIMARY (Save / Create) */
.btn-primary{
  border-radius: 14px;
  font-weight: 600;

  background: linear-gradient(
    180deg,
    var(--mj-teal),
    var(--mj-teal-dark)
  ) !important;

  box-shadow: 0 8px 18px rgba(0,150,136,.25);
}


/* ACTION BUTTON (Dropdown Aksi) */
.btn-aksi{

  height: 38px;
  padding: 0 14px;

  border-radius: 10px;
  border: none;

  font-weight: 600;
  font-size: 14px;

  color: #fff !important;

  background: linear-gradient(
    180deg,
    var(--mj-action),
    var(--mj-action-dark)
  ) !important;

  box-shadow: 0 6px 14px rgba(79,70,229,.25);

  display: inline-flex;
  align-items: center;
  gap: 6px;

  transition: all .15s ease;
}

.btn-aksi:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-aksi:active{
  transform: translateY(0);
}


/* SECONDARY BUTTON */
.btn-secondary-soft{

  background: #f4f6f8;
  border: 1px solid var(--mj-border);

  color: #344054;

  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 500;
}

.btn-secondary-soft:hover{
  background: #eef1f4;
}



/* =========================================================
   CARD POLISH
   ========================================================= */

.card{

  border-radius: 18px;

  border: 1px solid var(--mj-border);

  box-shadow:
  0 12px 30px rgba(18,26,44,.08);

}

.card-header{
  background: transparent;
  border-bottom: 1px solid var(--mj-border);
  font-weight: 600;
}



/* =========================================================
   TABLE SYSTEM
   ========================================================= */

.table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

/* wrapper table */
.table-responsive {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

/* table header */
.table thead {
  background: #f8fafc;
}

.table thead th {
  font-weight: 600;
  color: #344054;
  font-size: 13px;
  letter-spacing: .3px;
  border-bottom: 1px solid #e5e7eb;
}

/* table row */
.table tbody tr {
  transition: background .15s ease;
}

/* hover row */
.table tbody tr:hover {
  background: #f5f7fa;
}

/* cell border */
.table tbody td {
  border-bottom: 1px solid #f1f3f5;
}

/* hilangkan border row terakhir */
.table tbody tr:last-child td {
  border-bottom: none;
}

.table-fixed {
  table-layout: fixed;
  width: 100%;
}

.table-fixed td,
.table-fixed th {
  vertical-align: middle;
}

.table-fixed td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.img-cell img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

#tabelProduk {
  width: 100%;
  table-layout: auto;
}

#tabelProduk td,
#tabelProduk th {
  vertical-align: middle;
}

#tabelProduk tbody tr:hover {
  background: #f8fafc;
}

#tabelProduk td:last-child {
  text-align: center;
}

.btn-aksi {
  min-width: 80px;
}


/* =========================================================
   STATUS BADGES
   ========================================================= */

.badge-soft{

  padding: 6px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 600;

}

/* success */
.badge-success-soft{
  background: rgba(34,197,94,.12);
  color: var(--mj-success);
}

/* warning */
.badge-warning-soft{
  background: rgba(245,158,11,.12);
  color: var(--mj-warning);
}

/* danger */
.badge-danger-soft{
  background: rgba(239,68,68,.12);
  color: var(--mj-danger);
}

/* info */
.badge-info-soft{
  background: rgba(6,182,212,.12);
  color: var(--mj-info);
}



/* =========================================================
   INPUT SYSTEM
   ========================================================= */

.form-control{

  border-radius: 10px;
  border: 1px solid var(--mj-border);

  padding: 8px 12px;

  box-shadow: none;
}

.form-control:focus{

  border-color: var(--mj-teal);

  box-shadow:
  0 0 0 3px rgba(0,150,136,.15);

}



/* =========================================================
   DROPDOWN POLISH
   ========================================================= */

.dropdown-menu{

  border-radius: 12px;

  border: 1px solid var(--mj-border);

  box-shadow:
  0 16px 40px rgba(18,26,44,.18);

  padding: 6px;

}

.dropdown-item{

  border-radius: 8px;
  font-size: 14px;

}

.dropdown-item:hover{

  background: #f4f6f8;

}



/* =========================================================
   SEARCH INPUT STYLE
   ========================================================= */

.search-input{

  border-radius: 999px;

  padding-left: 36px;

}



/* =========================================================
   TAB POLISH
   ========================================================= */

.nav-tabs .nav-link{

  border-radius: 10px 10px 0 0;

  font-weight: 600;

}

.nav-tabs .nav-link.active{

  background: #fff;

  border-bottom: 2px solid var(--mj-teal);

  color: var(--mj-teal);

}

/* =========================
   NAVBAR DASHBOARD FIXED
========================= */

.navbar-dashboard{
  position: sticky;
  top: 0;
  z-index: 1030; /* di atas konten */
  background: #fff;
  height: 65px;
}

/* supaya tidak ketiban dropdown */
.navbar-dashboard .dropdown-menu{
  z-index: 1050;
}

/* icon navbar */
.navbar-dashboard i{
  font-size: 18px;
  cursor: pointer;
}

/* user profile */
.navbar-dashboard img{
  object-fit: cover;
}



/* =========================================================
   SMALL UI DETAILS
   ========================================================= */

/* subtle hover card */
.card:hover{
  transform: translateY(-2px);
}

/* table code style */
.mono{

  font-family:
  ui-monospace,
  SFMono-Regular,
  Menlo,
  Monaco,
  Consolas;

  font-size: 13px;

}

/* ============================================= */
/* UI MODAL CONFIRM */
/* ============================================= */
.confirm-modal{
  border-radius:16px;
  border:none;
  box-shadow:0 15px 40px rgba(0,0,0,0.15);
  animation: zoomModal .25s ease;
}

/* icon bulat */
.confirm-icon{
  width:70px;
  height:70px;
  margin:auto;
  border-radius:50%;
  background:linear-gradient(135deg,#4eb8df,#6fbcff);
  display:flex;
  align-items:center;
  justify-content:center;
  color:white;
  font-size:32px;
  box-shadow:0 8px 20px rgba(78,115,223,.4);
}

.sidebar-logo{
  width:36px;
  height:36px;
 
  object-fit:contain;
}

.sidebar-text-logo{
  height:36px;
  object-fit:contain;
}

/* tombol */
.btn-save{
  border-radius:8px;
  font-weight:500;
  transition:all .2s;
}

.btn-save:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 14px rgba(0,0,0,0.15);
}

.btn-cancel{
  border-radius:8px;
}

/* animasi zoom */
@keyframes zoomModal{
  from{
    transform:scale(.9);
    opacity:0;
  }
  to{
    transform:scale(1);
    opacity:1;
  }
}

.pagination .page-link {
  border: none;
  margin: 0 3px;
  border-radius: 10px;
  color: #555;
  transition: all 0.2s ease;
}

.pagination .page-link:hover {
  background-color: #e0f2f1;
  color: rgb(0, 121, 107);
}

/* ACTIVE */
.pagination .page-item.active .page-link {
  background: linear-gradient(
    180deg,
    rgb(0, 150, 136),
    rgb(0, 121, 107)
  );
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 121, 107, 0.3);
}

/* DISABLED */
.pagination .page-item.disabled .page-link {
  color: #bbb;
  background: #f8f9fa;
}

.btn-gradient {
  background: linear-gradient(
    180deg,
    rgb(0, 150, 136),
    rgb(0, 121, 107)
  );
  color: #fff;
  border: none;
}

.btn-gradient:hover {
  opacity: 0.9;
  color: #fff;
}

/* 🔥 Hilangkan warna hijau */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #0d6efd !important; /* biru bootstrap */
  border-color: #0d6efd !important;
  color: #fff;
}

/* hover */
.flatpickr-day:hover {
  background: #e7f1ff;
  color: #000;
}

/* range tengah */
.flatpickr-day.inRange {
  background: #cfe2ff !important;
  color: #000;
}

/* 🔥 hilangkan hijau input */
#filterTanggal:focus,
.flatpickr-input:focus {
  border-color: #ced4da !important;
  box-shadow: none !important;
}

/* kalau kena valid bootstrap */
.form-control.is-valid {
  border-color: #ced4da !important;
  background-image: none !important;
  box-shadow: none !important;
}

  #tabelHistoryHpp {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
  }

  #tabelHistoryHpp thead th {
    background: #17a2b8;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 14px;
    border: none;
    white-space: nowrap;
    vertical-align: middle;
  }

  #tabelHistoryHpp thead th:first-child {
    border-top-left-radius: 12px;
  }

  #tabelHistoryHpp thead th:last-child {
    border-top-right-radius: 12px;
  }

  #tabelHistoryHpp tbody td {
    padding: 12px 14px;
    font-size: 14px;
    vertical-align: middle;
    border-top: 1px solid #eef1f4;
    white-space: nowrap;
  }

  #tabelHistoryHpp tbody tr:hover {
    background-color: #f8fcfd;
  }

  #tabelHistoryHpp tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
  }

  #tabelHistoryHpp tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
  }

  #tabelHistoryHpp .col-no {
    width: 60px;
  }

  #tabelHistoryHpp .col-tanggal {
    min-width: 180px;
  }

  #tabelHistoryHpp .col-number {
    text-align: right;
  }

  #tabelHistoryHpp .col-text {
    text-align: left;
  }

  .history-hpp-wrapper {
    border: 1px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }

  .history-title {
    font-weight: 600;
    text-align: center;
    margin-bottom: 14px;
    color: #2c3e50;
  }

    .komposisi-disabled {
    opacity: 0.65;
  }

  .komposisi-disabled select,
  .komposisi-disabled input,
  .komposisi-disabled button {
    pointer-events: none;
  }