:root {
  --primary-navy: #1b1464;
  --deep-navy: #0a0e27;
  --secondary-navy: #2a2380;
  --gold: #c9a227;
  --gold-soft: #e4c667;
  --light-tint: #f1eef9;
  --bg-body: #f5f5fa;
  --sidebar-width: 260px;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6{font-family:'Playfair Display', Georgia, serif;}

/* ===================== LOGIN PAGE ===================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top right, var(--secondary-navy) 0%, var(--deep-navy) 55%, #05081a 100%);
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.login-card .brand-panel {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 34px 32px 22px;
  text-align: center;
}
.login-card .brand-panel .brand-logo{ height:26px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }

.login-card .form-panel {
  background: #fff;
  padding: 28px 32px 32px;
}
.form-panel h5{font-family:'Inter',sans-serif}

.demo-account {
  font-size: 0.78rem;
  background: var(--light-tint);
  border: 1px dashed #c9bce8;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.7;
}

.back-link{
  display:block;text-align:center;margin-top:18px;font-size:.82rem;
  color: var(--primary-navy); font-weight:600;
}
.back-link:hover{ color: var(--gold); }

.btn-primary{
  background-color: var(--primary-navy);
  border-color: var(--primary-navy);
}
.btn-primary:hover{
  background-color: var(--deep-navy);
  border-color: var(--deep-navy);
}

/* ===================== SIDEBAR ===================== */
body { margin: 0; }

#sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-navy) 0%, var(--deep-navy) 100%);
  top: 0;
  height: 100vh;
  height: 100dvh;
  transition: all 0.3s;
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar .sidebar-brand {
  flex: 0 0 auto;
}

/* Only the menu list scrolls; brand header and bottom actions stay pinned
   in view, so items below "Pengaturan" and the logout button are always
   reachable even on short screens. */
#sidebarMenu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

#sidebarMenu::-webkit-scrollbar { width: 6px; }
#sidebarMenu::-webkit-scrollbar-track { background: transparent; }
#sidebarMenu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

#sidebar .sidebar-actions {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-logout {
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #ffd7d7;
  background: rgba(239, 68, 68, 0.12);
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fff;
}

#sidebar .nav-link {
  color: rgba(255, 255, 255, 0.82);
  padding: 11px 18px;
  margin: 3px 14px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

#sidebar .nav-link .label-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  background-color: rgba(201, 162, 39, 0.16);
  color: #fff;
}
#sidebar .nav-link.active{
  box-shadow: inset 3px 0 0 var(--gold);
}

#sidebar .nav-link.locked {
  color: rgba(255, 255, 255, 0.38);
  cursor: not-allowed;
}

#sidebar .nav-link.locked:hover {
  background-color: transparent;
  transform: none;
}

#sidebar .nav-link i.bi-lock-fill,
#sidebar .nav-link i.fa-lock {
  font-size: 0.72rem;
  color: var(--gold-soft);
}

.btn-sidebar-ghost{
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.85);
  background: transparent;
}
.btn-sidebar-ghost:hover{
  background: rgba(255,255,255,.08);
  color: #fff;
}

.role-badge {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bg-primary-subtle{ background-color: var(--light-tint) !important; }
.text-primary{ color: var(--primary-navy) !important; }

/* ===================== MAIN CONTENT ===================== */
#content {
  margin-left: var(--sidebar-width);
  padding: 20px;
  transition: all 0.3s;
  width: calc(100% - var(--sidebar-width));
}

.metric-card {
  background: white;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(10, 14, 39, 0.06);
  border-left: 4px solid var(--gold);
  transition: transform 0.2s;
  height: 100%;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -6px rgba(10, 14, 39, 0.14);
}

.metric-card h6 {
  color: #64607e;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.metric-card h3 {
  color: var(--primary-navy);
  font-weight: 700;
  margin: 0;
}

.info-panel {
  background: var(--light-tint);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2dcf3;
}

.locked-page {
  background: #fff;
  border-radius: 16px;
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed #cbd0dc;
}

.locked-page i {
  font-size: 2.6rem;
  color: #a39fc0;
}

.permission-row {
  border-bottom: 1px solid #eef0f7;
  padding: 14px 0;
}
.permission-row:last-child {
  border-bottom: none;
}

.form-check-input:checked{
  background-color: var(--gold);
  border-color: var(--gold);
}

.btn-outline-primary{
  color: var(--primary-navy);
  border-color: var(--primary-navy);
}
.btn-outline-primary:hover,.btn-outline-primary.active{
  background-color: var(--primary-navy);
  border-color: var(--primary-navy);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  #sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  #sidebar.active {
    margin-left: 0;
  }
  #content {
    margin-left: 0;
    width: 100%;
  }
}
