:root {
--esb-teal: #0d9488;
--esb-teal-dark: #0f766e;
--esb-teal-light: #ccfbf1;
--sidebar-w: 260px;
--topbar-h: 56px;
--font: 'Plus Jakarta Sans', sans-serif;
}

* { font-family: var(--font); }

/* ── SIDEBAR ─────────────────────────────────────────── */
#sidebar {
width: var(--sidebar-w);
min-height: 100vh;
background: #fff;
border-right: 1px solid #e5e7eb;
position: fixed;
top: 0; left: 0; bottom: 0;
z-index: 1040;
display: flex;
flex-direction: column;
transition: transform .3s ease;
overflow-y: auto;
}
#sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-brand {
background: var(--esb-teal);
padding: 0 1rem;
height: var(--topbar-h);
display: flex;
align-items: center;
gap: .6rem;
flex-shrink: 0;
}
.brand-logo {
background: #fff;
color: var(--esb-teal);
font-weight: 800;
font-size: .8rem;
letter-spacing: .05em;
padding: .25rem .5rem;
border-radius: 6px;
white-space: nowrap;
}
.brand-logo span { color: #0d9488; }

.sidebar-user {
padding: .85rem 1rem;
border-bottom: 1px solid #f1f5f9;
display: flex;
align-items: center;
gap: .65rem;
}
.sidebar-user .avatar {
width: 34px; height: 34px;
background: var(--esb-teal-light);
color: var(--esb-teal-dark);
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 1rem; flex-shrink: 0;
}
.sidebar-user .name { font-weight: 600; font-size: .8rem; line-height: 1.2; }
.sidebar-user .company { font-size: .7rem; color: #6b7280; }

/* nav */
.sidebar-nav { list-style: none; padding: .5rem 0; margin: 0; flex: 1; }
.sidebar-nav .nav-section {
font-size: .65rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: .1em;
color: #9ca3af;
padding: .75rem 1rem .25rem;
}
.sidebar-nav .nav-item > a,
.sidebar-nav .nav-item > button {
display: flex;
align-items: center;
gap: .6rem;
width: 100%;
padding: .5rem 1rem;
font-size: .82rem;
font-weight: 500;
color: #374151;
text-decoration: none;
background: none;
border: none;
text-align: left;
border-radius: 0;
transition: background .15s, color .15s;
}
.sidebar-nav .nav-item > a:hover,
.sidebar-nav .nav-item > button:hover {
background: #f0fdfa;
color: var(--esb-teal-dark);
}
.sidebar-nav .nav-item > a.active,
.sidebar-nav .nav-item > button.active {
background: var(--esb-teal-light);
color: var(--esb-teal-dark);
font-weight: 600;
border-left: 3px solid var(--esb-teal);
}
.sidebar-nav .nav-item > a i,
.sidebar-nav .nav-item > button i { font-size: .95rem; }

/* sub-menu */
.sub-menu { list-style: none; padding: 0; margin: 0; }
.sub-menu li a {
display: flex; align-items: center; gap: .5rem;
padding: .42rem 1rem .42rem 2.6rem;
font-size: .8rem;
color: #4b5563;
text-decoration: none;
transition: background .15s, color .15s;
}
.sub-menu li a:hover { background: #f0fdfa; color: var(--esb-teal-dark); }
.sub-menu li a.active {
color: var(--esb-teal-dark);
font-weight: 600;
background: #f0fdfa;
}
.sub-menu li a::before {
content: '';
width: 5px; height: 5px;
border-radius: 50%;
background: currentColor;
flex-shrink: 0;
}

/* chevron */
.chevron { margin-left: auto; transition: transform .2s; font-size: .75rem !important; }
.nav-item > button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* ── TOPBAR ──────────────────────────────────────────── */
#topbar {
height: var(--topbar-h);
background: var(--esb-teal);
position: fixed;
top: 0;
left: var(--sidebar-w);
right: 0;
z-index: 1030;
display: flex;
align-items: center;
padding: 0 1rem;
gap: .75rem;
transition: left .3s ease;
}
#topbar.expanded { left: 0; }

.topbar-toggle {
background: none; border: none;
color: #fff; font-size: 1.2rem;
display: flex; align-items: center; justify-content: center;
padding: .3rem; border-radius: 6px;
cursor: pointer;
transition: background .15s;
}
.topbar-toggle:hover { background: rgba(255,255,255,.15); }

.topbar-icons { display: flex; align-items: center; gap: .3rem; }
.topbar-icon-btn {
background: none; border: none;
color: #fff; font-size: 1.05rem;
width: 34px; height: 34px;
display: flex; align-items: center; justify-content: center;
border-radius: 8px;
cursor: pointer; position: relative;
transition: background .15s;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,.15); }
.topbar-icon-btn .badge {
position: absolute; top: 3px; right: 3px;
font-size: .55rem; padding: .15em .35em;
}

.topbar-company {
display: flex; align-items: center; gap: .4rem;
color: #fff; font-size: .82rem; font-weight: 600;
cursor: pointer; padding: .3rem .6rem;
border-radius: 8px;
transition: background .15s;
}
.topbar-company:hover { background: rgba(255,255,255,.15); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .4rem; }

/* ── MAIN CONTENT ────────────────────────────────────── */
#main-content {
margin-left: var(--sidebar-w);
margin-top: var(--topbar-h);
padding: 1.5rem;
min-height: calc(100vh - var(--topbar-h));
background: #f8fafc;
transition: margin-left .3s ease;
}
#main-content.expanded { margin-left: 0; }

/* page card */
.page-card {
background: #fff;
border-radius: 12px;
border: 1px solid #e5e7eb;
box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.page-card-header {
padding: 1rem 1.25rem;
border-bottom: 1px solid #f1f5f9;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: .5rem;
}
.page-title {
font-size: 1.05rem; font-weight: 700; color: #111827; margin: 0;
}

/* toolbar buttons */
.btn-esb {
background: var(--esb-teal);
color: #fff;
border: none;
font-size: .8rem;
font-weight: 600;
padding: .4rem .85rem;
border-radius: 8px;
display: inline-flex; align-items: center; gap: .35rem;
transition: background .15s;
}
.btn-esb:hover { background: var(--esb-teal-dark); color: #fff; }
.btn-icon {
background: none;
border: 1px solid #d1d5db;
color: #6b7280;
padding: .38rem .55rem;
border-radius: 8px;
display: inline-flex; align-items: center; justify-content: center;
font-size: .9rem;
transition: background .15s, color .15s;
cursor: pointer;
}
.btn-icon:hover { background: #f1f5f9; color: #374151; }
.btn-icon.danger:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* DataTable overrides */
.dataTables_wrapper .dataTables_filter input {
border-radius: 8px; border: 1px solid #d1d5db;
padding: .3rem .7rem; font-size: .82rem;
}
.dataTables_wrapper .dataTables_length select {
border-radius: 8px; border: 1px solid #d1d5db;
padding: .3rem .5rem; font-size: .82rem;
}
#prodTable thead th {
background: #f8fafc;
color: var(--esb-teal-dark);
font-weight: 700;
font-size: .78rem;
text-transform: uppercase;
letter-spacing: .05em;
border-bottom: 2px solid #e5e7eb;
white-space: nowrap;
}
#prodTable tbody tr { font-size: .82rem; }
#prodTable tbody tr:hover { background: #f0fdfa; }
#prodTable td { vertical-align: middle; }

.badge-auth {
background: #d1fae5; color: #065f46;
font-size: .7rem; font-weight: 600;
padding: .25em .65em; border-radius: 20px;
}
.badge-pending {
background: #fef3c7; color: #92400e;
font-size: .7rem; font-weight: 600;
padding: .25em .65em; border-radius: 20px;
}
.badge-rejected {
background: #fee2e2; color: #991b1b;
font-size: .7rem; font-weight: 600;
padding: .25em .65em; border-radius: 20px;
}

.action-view {
color: var(--esb-teal); font-size: 1rem; cursor: pointer;
background: none; border: none; padding: 0;
transition: color .15s;
}
.action-view:hover { color: var(--esb-teal-dark); }

/* sidebar overlay (mobile) */
#sidebar-overlay {
display: none;
position: fixed; inset: 0;
background: rgba(0,0,0,.35);
z-index: 1039;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 991.98px) {
#sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
#sidebar.mobile-open { transform: translateX(0); }
#sidebar-overlay.active { display: block; }
#topbar { left: 0 !important; }
#main-content { margin-left: 0 !important; }
}

/* ── STICKY COLUMN ACTION ─────────────────────────── */
.sticky-table-wrap {
  position: relative;
}

.col-sticky-right {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  /* garis pembatas kiri agar terlihat terpisah */
  box-shadow: -3px 0 6px -2px rgba(0, 0, 0, .08);
  white-space: nowrap;
}

/* saat row di-hover, background sticky ikut berubah */
#prodTable tbody tr:hover td.col-sticky-right {
  background: #f0fdfa;
}

/* thead sticky juga harus ikut */
#prodTable thead th.col-sticky-right {
  background: #f8fafc;
  z-index: 3;
}
/* ── ANIMASI MUNCUL/HILANG SCROLLBAR ────────────────── */

/* 1. Base Sidebar: Set warna default ke transparan */
#sidebar {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent; /* Untuk Firefox */
    transition: scrollbar-color 0.4s ease;
}

/* 2. Webkit (Chrome/Edge/Safari) - Track */
#sidebar::-webkit-scrollbar {
    width: 6px; /* Sedikit lebih lebar agar mudah diklik saat muncul */
}

/* 3. Webkit - Thumb (Batang Scroll) */
#sidebar::-webkit-scrollbar-thumb {
    background-color: transparent; /* Default: Hilang */
    border-radius: 20px;
    border: 2px solid transparent; /* Memberi ruang agar terlihat cantik */
    background-clip: content-box;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 4. ANIMASI: Muncul saat Sidebar di-hover */
#sidebar:hover::-webkit-scrollbar-thumb {
    background-color: var(--esb-teal);
}

/* 5. Efek saat kursor tepat di atas scrollbar (lebih gelap) */
#sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--esb-teal-dark) !important;
}

/* 6. Firefox Support: Animasi muncul */
#sidebar:hover {
    scrollbar-color: var(--esb-teal) transparent;
}