/* ── Nex Panel Brand Colors ── */
:root {
  --nex-primary:   #2563eb;
  --nex-secondary: #0ea5e9;
  --nex-gradient:  linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

/* ════════════════════════════════════════════
   UST Modern CMS — Panel Stylesheet
   Sticky navbar + sticky sidebar + colored icons
   ════════════════════════════════════════════ */

/* ── Reset body layout ── */
html, body {
  height: 100%;
  overflow: hidden; /* body tidak scroll — inner yang scroll */
}
body {
  display: flex;
  flex-direction: column;
}

/* ── Navbar: selalu di atas ── */
.navbar {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* Banner impersonasi di atas navbar */
.impersonate-bar {
  flex-shrink: 0;
}

/* ── Wrapper utama: isi sisa tinggi layar ── */
.main-wrapper {
  flex: 1;
  display: flex;
  overflow: hidden; /* anak yang scroll, bukan ini */
  height: calc(100vh - 56px); /* 56px = tinggi navbar */
}

/* ── Sidebar: scroll sendiri jika konten panjang ── */
.sidebar-col {
  width: 200px;
  min-width: 180px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem .5rem;
}
.sidebar-col::-webkit-scrollbar { width: 4px; }
.sidebar-col::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }

/* ── Main content: scroll di area ini ── */
.main-col {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1.75rem;
}

/* ── Nav pills sidebar ── */
.sidebar .nav-link {
  border-radius: .5rem;
  padding: .45rem .65rem;
  font-size: .875rem;
  color: #343a40;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
}
.sidebar .nav-link.active {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff !important;
}
.sidebar .nav-link.active i { color: #fff !important; }
.sidebar .nav-link:hover:not(.active) {
  background: #f1f3f5;
  color: #000;
}

/* ── Icon berwarna per menu ── */
.sidebar .nav-link i.bi-speedometer2        { color: #0d6efd; }
.sidebar .nav-link i.bi-box-seam            { color: #fd7e14; }
.sidebar .nav-link i.bi-file-text           { color: #20c997; }
.sidebar .nav-link i.bi-tags                { color: #6f42c1; }
.sidebar .nav-link i.bi-images              { color: #e83e8c; }
.sidebar .nav-link i.bi-layout-sidebar      { color: #17a2b8; }
.sidebar .nav-link i.bi-file-earmark-richtext { color: #28a745; }
.sidebar .nav-link i.bi-building            { color: #6c757d; }
.sidebar .nav-link i.bi-search-heart        { color: #dc3545; }
.sidebar .nav-link i.bi-megaphone           { color: #ffc107; }
.sidebar .nav-link i.bi-person-badge        { color: #0dcaf0; }
.sidebar .nav-link i.bi-people              { color: #6610f2; }
.sidebar .nav-link i.bi-gear                { color: #495057; }
.sidebar .nav-link i.bi-key                 { color: #ffc107; }
.sidebar .nav-link i.bi-folder-plus         { color: #28a745; }

/* ── Misc ── */
.card { border-radius: .75rem; }
code.user-select-all { cursor: copy; }

/* ── Mobile: sidebar di atas (stack) ── */
@media (max-width: 767px) {
  .main-wrapper { flex-direction: column; height: auto; overflow: visible; }
  html, body { overflow: auto; }
  .sidebar-col { width: 100%; height: auto; overflow: visible; border-right: none; border-bottom: 1px solid #dee2e6; }
  .main-col { overflow: visible; }
}

/* ════════════════════════════════════════════
   UST Custom WYSIWYG Editor
   ════════════════════════════════════════════ */
.ust-editor-wrap {
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  overflow: hidden;
  background: #fff;
}
.ust-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: .4rem .5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  align-items: center;
}
.ust-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 .4rem;
  border: 1px solid transparent;
  border-radius: .35rem;
  background: transparent;
  cursor: pointer;
  font-size: .8rem;
  color: #343a40;
  line-height: 1;
  transition: background .1s;
}
.ust-btn:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}
.ust-btn-active {
  background: #0d6efd !important;
  color: #fff !important;
  border-color: #0d6efd !important;
}
.ust-sep {
  width: 1px;
  height: 20px;
  background: #dee2e6;
  margin: 0 3px;
  display: inline-block;
}
.ust-editor {
  min-height: 280px;
  max-height: 600px;
  overflow-y: auto;
  padding: 1rem;
  outline: none;
  font-size: .95rem;
  line-height: 1.7;
  color: #212529;
}
.ust-editor:focus {
  box-shadow: none;
  outline: none;
}
/* Konten dalam editor */
.ust-editor h1,.ust-editor h2,.ust-editor h3,.ust-editor h4 {
  margin-top: 1rem;
  margin-bottom: .5rem;
  font-weight: 600;
}
.ust-editor h2 { font-size: 1.4rem; }
.ust-editor h3 { font-size: 1.2rem; }
.ust-editor h4 { font-size: 1rem; }
.ust-editor p  { margin-bottom: .75rem; }
.ust-editor ul,.ust-editor ol { padding-left: 1.5rem; margin-bottom: .75rem; }
.ust-editor blockquote {
  border-left: 4px solid #dee2e6;
  padding: .5rem 1rem;
  color: #6c757d;
  margin: .75rem 0;
}
.ust-editor a { color: #0d6efd; }
.ust-editor img { max-width: 100%; border-radius: .5rem; }
.ust-editor code {
  background: #f8f9fa;
  padding: .1em .3em;
  border-radius: .25em;
  font-size: .9em;
}
/* Placeholder */
.ust-editor:empty:before,
.ust-editor p:first-child:last-child:empty:before {
  content: attr(data-placeholder);
  color: #adb5bd;
  pointer-events: none;
}
