:root {
  --pln-navy-dark: #082344;
  --pln-navy: #0d335f;
  --pln-navy-light: #15457d;
  --pln-blue: #0072ef;
  --pln-cyan: #00a2e9;
  --pln-yellow: #fff200;
  --pln-red: #ed1c24;
  --ruptl-blue: #0d6efd;
  --kinerja-green: #129c6b;
  --perencanaan-purple: #6b4ce6;
  --bg-main: #f3f6fa;
  --bg-sidebar: #f8fafd;
  --text-dark: #0f2540;
  --text-muted: #5a6e85;
  --border-color: #e2e8f0;
  --card-shadow: 0 10px 28px -6px rgba(13, 51, 95, 0.08), 0 4px 12px -2px rgba(13, 51, 95, 0.04);
  --card-shadow-hover: 0 20px 38px -8px rgba(13, 51, 95, 0.16), 0 8px 20px -4px rgba(0, 114, 239, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==================== TOP NAVBAR ==================== */
.topbar {
  height: 58px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #09264a 0%, #103868 60%, #0b2d56 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  background: transparent;
  padding: 0;
}

.logo-item {
  background: transparent;
  object-fit: contain;
  display: block;
}

.logo-danantara {
  height: 24px;
  width: auto;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.35));
}

.logo-uip {
  height: 32px;
  width: auto;
  object-fit: contain;
  background: transparent;
}

.logo-pln-img {
  height: 30px;
  width: auto;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.topbar-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 4px;
}

.portal-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #f8fafc;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.auth-badge-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
}

.auth-badge-top.authenticated {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.auth-badge-top .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.auth-badge-top.authenticated .status-dot {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.notif-btn {
  position: relative;
  background: transparent;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0d335f;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 10px;
  transition: background 0.2s;
  position: relative;
}

.user-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--pln-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-greeting {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

/* ==================== LAYOUT CONTAINER ==================== */
.app-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 58px);
  min-height: 0;
  overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 242px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid #e5eaf2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 13px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #2c425d;
  font-family: inherit;
  font-size: 0.89rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item svg.nav-icon {
  width: 20px;
  height: 20px;
  color: #1e3a5f;
  transition: color 0.2s, transform 0.2s;
}

.nav-item:hover {
  background: #e8f1fd;
  color: var(--pln-blue);
}

.nav-item:hover svg.nav-icon {
  color: var(--pln-blue);
  transform: translateX(2px);
}

.nav-item.active {
  background: #dcebfb;
  color: #0958d9;
  font-weight: 700;
}

.nav-item.active svg.nav-icon {
  color: #0958d9;
}

.lock-indicator {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef2f7;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.nav-item:hover .lock-indicator {
  background: rgba(0, 114, 239, 0.12);
  color: var(--pln-blue);
}

.lock-indicator.unlocked {
  background: rgba(18, 156, 107, 0.12);
  color: var(--kinerja-green);
}

.sidebar-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 10px 6px;
}

.nav-item.secondary {
  color: #64748b;
  font-weight: 500;
  font-size: 0.85rem;
}

.nav-item.secondary svg.nav-icon {
  color: #64748b;
}

.sidebar-footer {
  margin-top: 12px;
  padding: 10px 10px 4px;
  border-top: 1px solid #e5eaf2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eco-tagline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.eco-leaf {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: #22c55e;
  filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.25));
}

.sidebar-partner-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 2px 0;
}

.sidebar-partner-box img {
  height: 32px;
  width: auto;
  object-fit: contain;
  background: transparent;
}

/* ==================== MAIN CONTENT (FIXED WINDOW) ==================== */
.main-content {
  flex: 1;
  height: 100%;
  min-height: 0;
  padding: 14px 24px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.portal-home-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

/* ==================== HERO BANNER WITH TRANSMISSION LINE ANIMATION ==================== */
.hero-banner {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 clamp(150px, 24vh, 210px);
  min-height: 150px;
  background: #082b52;
  box-shadow: 0 12px 32px -8px rgba(8, 35, 68, 0.28);
  display: flex;
  align-items: center;
  margin-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Right side real transmission tower photograph */
.hero-photo-layer {
  position: absolute;
  top: 0;
  right: 0;
  width: 62%;
  height: 100%;
  background-image: url('assets/hero-tower.png');
  background-size: 100% 100%;
  background-position: right center;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Smooth gradient blending left navy into the right photograph */
.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #062546 0%,
    #0a315b 36%,
    rgba(11, 52, 94, 0.88) 45%,
    rgba(14, 62, 110, 0.25) 58%,
    rgba(14, 62, 110, 0.0) 72%
  );
  z-index: 2;
  pointer-events: none;
}

/* SVG Transmission Electricity Animation Layer aligned to hero-tower.png */
.hero-electricity-svg {
  position: absolute;
  top: 0;
  right: 0;
  width: 62%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* Base subtle glow along the cables */
.cable-glow-base {
  fill: none;
  stroke: rgba(56, 189, 248, 0.28);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 3px rgba(0, 242, 254, 0.45));
}

/* Primary cyan high-voltage current flow */
.electric-flow-cyan {
  fill: none;
  stroke: url(#cyanEnergyGrad);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-dasharray: 28 150;
  filter: drop-shadow(0 0 6px #00f2fe) drop-shadow(0 0 12px #0284c7);
  animation: flowAlongCable 3.2s linear infinite;
}

/* Secondary golden-yellow power surge packets */
.electric-flow-gold {
  fill: none;
  stroke: url(#goldEnergyGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 16 190;
  filter: drop-shadow(0 0 7px #fde047) drop-shadow(0 0 14px #f59e0b);
  animation: flowAlongCable 3.2s linear infinite;
  animation-delay: -1.6s;
}

/* Fast micro-sparks along cables */
.electric-flow-spark {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 6 220;
  filter: drop-shadow(0 0 6px #ffffff) drop-shadow(0 0 10px #38bdf8);
  animation: flowAlongCable 2.1s linear infinite;
}

/* Different timing variations so cables look organic and alive */
.delay-1 { animation-delay: -0.45s; }
.delay-2 { animation-delay: -1.1s; }
.delay-3 { animation-delay: -1.85s; }
.delay-4 { animation-delay: -2.4s; }
.speed-fast { animation-duration: 2.45s; }
.speed-med { animation-duration: 3.0s; }
.speed-slow { animation-duration: 3.7s; }

/* Boost mode when user toggles 500kV Surge */
.hero-banner.boost-mode .electric-flow-cyan {
  stroke-width: 3.2;
  stroke-dasharray: 45 110;
  animation-duration: 1.4s !important;
}
.hero-banner.boost-mode .electric-flow-gold {
  stroke-width: 3.4;
  stroke-dasharray: 28 130;
  animation-duration: 1.4s !important;
}
.hero-banner.boost-mode .electric-flow-spark {
  stroke-width: 2.2;
  animation-duration: 0.95s !important;
}

@keyframes flowAlongCable {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -360;
  }
}

/* Insulator node pulse on the transmission towers */
.insulator-node {
  fill: #e0f2fe;
  filter: drop-shadow(0 0 6px #00f2fe) drop-shadow(0 0 12px #38bdf8);
  animation: insulatorPulse 2s ease-in-out infinite alternate;
}

.insulator-node.gold {
  fill: #fef08a;
  filter: drop-shadow(0 0 6px #facc15) drop-shadow(0 0 12px #eab308);
  animation-delay: -0.8s;
}

@keyframes insulatorPulse {
  0% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
  100% {
    opacity: 0.5;
    transform: scale(0.95);
  }
}

.hero-content {
  position: relative;
  z-index: 4;
  padding: 18px 32px;
  max-width: 560px;
  color: #ffffff;
}

.hero-welcome {
  font-size: 0.9rem;
  font-weight: 500;
  color: #bae6fd;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-grid-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 242, 254, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.live-grid-pill .pulse-bolt {
  color: #fde047;
  animation: boltFlash 1.5s infinite;
}

@keyframes boltFlash {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.18); }
}

.hero-title {
  font-size: clamp(1.32rem, 2.2vh + 0.55rem, 1.78rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}

.hero-subtitle {
  font-size: clamp(0.79rem, 1.1vh + 0.35rem, 0.9rem);
  line-height: 1.45;
  color: #dbeafe;
  font-weight: 400;
}

.hero-controls {
  position: absolute;
  bottom: 10px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-boost-btn {
  background: rgba(8, 35, 68, 0.76);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.grid-boost-btn:hover {
  background: rgba(14, 116, 144, 0.85);
  border-color: #fde047;
  color: #fff;
  transform: translateY(-1px);
}

.grid-boost-btn.active {
  background: linear-gradient(90deg, #0284c7, #0369a1);
  border-color: #fde047;
  color: #fef08a;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.55);
}

/* ==================== 3 MAIN MENU CARDS ==================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

.portal-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.portal-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.card-image-wrapper {
  position: relative;
  flex: 0 0 clamp(104px, 17.5vh, 154px);
  height: clamp(104px, 17.5vh, 154px);
  width: 100%;
  overflow: visible;
}

.card-image-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #0d2e57;
}

.card-image-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portal-card:hover .card-image-clip img {
  transform: scale(1.05);
}

/* Mini animated electricity overlay on Card 1 (Project RUPTL) */
.card-mini-electric-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Lock status chip on top-right of each card */
.card-auth-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  background: rgba(9, 30, 58, 0.75);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
}

.card-auth-chip.unlocked {
  background: rgba(16, 185, 129, 0.88);
  color: #ffffff;
  border-color: rgba(167, 243, 208, 0.6);
}

/* Circular overlapping icon badge positioned cleanly over the bottom-left image corner */
.card-icon-badge {
  position: absolute;
  bottom: -22px;
  left: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  z-index: 5;
  box-shadow: 0 6px 16px rgba(15, 37, 64, 0.16);
  transition: transform 0.3s ease;
}

.portal-card:hover .card-icon-badge {
  transform: scale(1.08);
}

.card-icon-badge.ruptl {
  background: linear-gradient(135deg, #1b78f2 0%, #0b5ed7 100%);
}

.card-icon-badge.kinerja {
  background: linear-gradient(135deg, #16a374 0%, #0d855d 100%);
}

.card-icon-badge.perencanaan {
  background: linear-gradient(135deg, #7451eb 0%, #5835d4 100%);
}

.card-body {
  padding: 28px 20px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  justify-content: space-between;
}

.card-title {
  font-size: clamp(0.96rem, 1.4vh + 0.3rem, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #0f2540;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.card-desc {
  font-size: clamp(0.78rem, 1.1vh + 0.25rem, 0.87rem);
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: auto;
  transition: gap 0.2s ease;
}

.portal-card:hover .card-cta {
  gap: 13px;
}

.card-cta.ruptl { color: var(--ruptl-blue); }
.card-cta.kinerja { color: var(--kinerja-green); }
.card-cta.perencanaan { color: var(--perencanaan-purple); }

/* Bottom colored accent bar on each card */
.card-bottom-bar {
  height: 5px;
  width: 100%;
  flex-shrink: 0;
}

.card-bottom-bar.ruptl { background: var(--ruptl-blue); }
.card-bottom-bar.kinerja { background: var(--kinerja-green); }
.card-bottom-bar.perencanaan { background: var(--perencanaan-purple); }

/* ==================== MODULE DASHBOARD VIEW (WHEN AUTHENTICATED) ==================== */
.module-view {
  display: none;
  animation: fadeSlideUp 0.28s ease forwards;
}

.module-view.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.module-active .main-content {
  max-width: 100%;
  padding: 12px 16px 8px;
}

body.module-active .portal-footer {
  margin-top: 8px;
  padding-top: 8px;
}

body.module-expanded .sidebar {
  display: none;
}

body.module-expanded .main-content {
  max-width: 100%;
  padding: 8px 12px 8px;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.module-workspace-bar,
.module-header-banner {
  border-radius: 14px 14px 0 0;
  padding: 10px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 20px -6px rgba(13, 51, 95, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
}

.module-workspace-bar.ruptl,
.module-header-banner.ruptl {
  background: linear-gradient(115deg, #082344 0%, #0d3b72 52%, #0072ef 100%);
}

.module-workspace-bar.kinerja,
.module-header-banner.kinerja {
  background: linear-gradient(115deg, #082344 0%, #094a3d 52%, #129c6b 100%);
}

.module-workspace-bar.perencanaan,
.module-header-banner.perencanaan {
  background: linear-gradient(115deg, #082344 0%, #2a1d66 52%, #6b4ce6 100%);
}

.module-workspace-left,
.module-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.82);
}

.module-breadcrumb a {
  color: #bae6fd;
  text-decoration: none;
  font-weight: 600;
}

.module-breadcrumb a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.module-sso-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.24);
  border: 1px solid rgba(110, 231, 183, 0.5);
  color: #d1fae5;
}

.module-workspace-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.module-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.module-sub-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e0f2fe;
}

.module-subtitle {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.88);
}

.module-workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-workspace-tool,
.btn-back-portal {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.btn-workspace-tool:hover,
.btn-back-portal:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.btn-back-portal {
  background: rgba(8, 35, 68, 0.45);
  border-color: rgba(125, 211, 252, 0.45);
}

.module-frame-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px -8px rgba(8, 35, 68, 0.12);
  display: flex;
  flex-direction: column;
}

.module-app-frame {
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
  border: none;
  display: block;
  background: #f4f7fb;
}

.module-frame-loader {
  position: absolute;
  inset: 0;
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 5;
  color: #0d335f;
  font-size: 0.88rem;
  font-weight: 700;
  transition: opacity 0.25s ease;
}

.module-frame-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.module-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3.5px solid #cbd5e1;
  border-top-color: #0072ef;
  animation: moduleSpin 0.75s linear infinite;
}

@keyframes moduleSpin {
  to {
    transform: rotate(360deg);
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--card-shadow);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f2540;
  margin-bottom: 6px;
}

.kpi-trend {
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
}

.kpi-trend.up {
  background: #dcfce7;
  color: #15803d;
}

.kpi-trend.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.module-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 22px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.module-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.module-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f2540;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.progress-bar-wrap {
  width: 100%;
  background: #e2e8f0;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-pill.construct { background: #dbeafe; color: #1d4ed8; }
.status-pill.cod { background: #dcfce7; color: #15803d; }
.status-pill.plan { background: #ede9fe; color: #6d28d9; }

/* ==================== FOOTER ==================== */
.portal-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 9px;
  margin-top: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.76rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-right {
  font-style: italic;
  color: #64748b;
  font-weight: 500;
}

/* ==================== MANDATORY LOGIN MODAL ==================== */
.login-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 22, 46, 0.78);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.login-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.login-modal-card {
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 60px -12px rgba(4, 15, 35, 0.55);
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-modal-backdrop.open .login-modal-card {
  transform: translateY(0) scale(1);
}

/* Left visual panel of Login Modal with animated transmission grid */
.login-visual-side {
  background: linear-gradient(150deg, #061f3e 0%, #0c3566 55%, #0e4a8a 100%);
  color: #ffffff;
  padding: 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-visual-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

.login-visual-top {
  position: relative;
  z-index: 2;
}

.login-brand-strip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 18px;
  box-shadow: none;
}

.login-brand-strip img {
  height: 26px;
  width: auto;
  object-fit: contain;
  background: transparent;
}

.login-visual-title {
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.login-visual-desc {
  font-size: 0.83rem;
  line-height: 1.52;
  color: #bae6fd;
}

.login-security-box {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 16px;
  backdrop-filter: blur(4px);
}

.login-security-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7dd3fc;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-target-module-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fde047;
}

/* Right form side of Login Modal */
.login-form-side {
  padding: 22px 30px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

.login-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.login-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fecaca;
}

.login-form-header {
  margin-bottom: 12px;
}

.mandatory-auth-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  margin-bottom: 6px;
}

.login-form-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f2540;
  margin-bottom: 4px;
}

.login-form-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.38;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.input-box svg.input-icon {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0f2540;
  background: #f8fafc;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--pln-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 114, 239, 0.14);
}

.toggle-pass-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  font-size: 0.76rem;
  font-weight: 600;
}

.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 0.8rem;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  cursor: pointer;
}

.demo-autofill-btn {
  background: #f0f9ff;
  border: 1px dashed #38bdf8;
  color: #0284c7;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.demo-autofill-btn:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.login-error-msg {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.login-error-msg.show {
  display: block;
}

.btn-submit-login {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #0d3b66 0%, #0072ef 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px -4px rgba(0, 114, 239, 0.45);
  transition: all 0.25s ease;
}

.btn-submit-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -4px rgba(0, 114, 239, 0.55);
}

.domain-hint-pill {
  position: absolute;
  right: 10px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #bae6fd;
  transition: all 0.2s;
  user-select: none;
}

.domain-hint-pill:hover {
  background: #0284c7;
  color: #ffffff;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.auth-tab-btn {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: #0d3b66;
  box-shadow: 0 2px 6px rgba(15, 37, 64, 0.08);
}

.label-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.label-row-between .form-label {
  margin-bottom: 0;
}

.link-manage-users {
  background: transparent;
  border: none;
  color: #0284c7;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.link-manage-users:hover {
  color: #0369a1;
}

.btn-send-otp {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-send-otp:hover {
  background: #dbeafe;
}

.otp-input-spacing {
  letter-spacing: 4px;
  font-weight: 800;
  font-size: 1rem;
}

.login-info-msg {
  display: none;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  line-height: 1.45;
}

.login-info-msg.show {
  display: block;
}

/* Modal Whitelist Pegawai */
.whitelist-modal-card {
  width: 100%;
  max-width: 740px;
  background: #ffffff;
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 28px 60px -12px rgba(4, 15, 35, 0.55);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.whitelist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.whitelist-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f2540;
}

.whitelist-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}

.whitelist-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.whitelist-add-form .form-input {
  flex: 1;
  min-width: 150px;
}

.btn-add-emp {
  background: #0072ef;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.whitelist-table-wrap {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.btn-del-emp {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.whitelist-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.btn-back-login {
  background: #0d3b66;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.reg-role-banner {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.78rem;
  margin-bottom: 14px;
  line-height: 1.4;
}

.reg-role-banner.first-admin {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #854d0e;
}

.reg-role-banner.regular-user {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.otp-verification-box {
  background: #f0fdf4;
  border: 1.5px dashed #22c55e;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.admin-pending-pill {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.admin-edit-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
}

.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-approve-emp {
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-approve-emp:hover {
  background: #15803d;
}

.btn-edit-emp {
  background: #e0f2fe;
  color: #0369a1;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-edit-emp:hover {
  background: #bae6fd;
}

/* Toast Notification */
.portal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f2540;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  z-index: 1200;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid #38bdf8;
}

.portal-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive adjustments (Mobile & Tablet) */
@media (max-width: 1080px) {
  html,
  body {
    height: auto;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-layout,
  .main-content,
  .portal-home-view {
    height: auto;
    overflow: visible;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-photo-layer,
  .hero-electricity-svg {
    width: 100%;
    opacity: 0.45;
  }
  .hero-gradient-overlay {
    background: linear-gradient(90deg, #062546 0%, rgba(10, 49, 91, 0.85) 100%);
  }
}

@media (max-width: 820px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5eaf2;
  }
  .login-modal-card {
    grid-template-columns: 1fr;
  }
  .login-visual-side {
    padding: 24px;
  }
  .partner-logos-pill {
    display: none;
  }
}


/* ==================== SUBMENU RUPTL ==================== */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-item-right-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.submenu-chevron {
  color: #64748b;
  transition: transform 0.25s ease;
}

.nav-item.active .submenu-chevron {
  color: #0958d9;
}

.nav-group.expanded .submenu-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding-left: 10px;
  margin: 4px 6px 6px 18px;
  border-left: 2px solid #dcebfb;
  animation: submenuFadeIn 0.2s ease-out;
}

.nav-group.expanded .sidebar-submenu,
body.in-ruptl #submenu-ruptl {
  display: flex !important;
}

@keyframes submenuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.submenu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #415774;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.submenu-item .sub-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.submenu-item .sub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.submenu-item:hover {
  background: #e8f1fd;
  color: var(--pln-blue);
}

.submenu-item:hover .sub-dot {
  background: var(--pln-blue);
  transform: scale(1.25);
}

.submenu-item.active {
  background: linear-gradient(135deg, #0072ef 0%, #0098ea 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 114, 239, 0.28);
}

.submenu-item.active .sub-dot {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.submenu-item .sub-badge {
  font-size: 0.66rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 800;
  background: #f59e0b;
  color: #ffffff;
  line-height: 1.3;
}

.submenu-item.active .sub-badge {
  background: #ffffff;
  color: #0072ef;
}