:root {
  --sp-biru: #1a73e8;
  --sp-biru-tua: #0b4fb3;
  --sp-aksen: #f5a623;
  --sp-bg: #f4f7fc;
  --sp-card: #ffffff;
  --sp-abu: #64748b;
  --sp-text: #0f172a;
  --sp-radius: 14px;
  --sp-shadow: 0 4px 16px rgba(15, 40, 80, .08);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }

body.login-page {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0b4fb3 0%, #1a73e8 55%, #2b8cff 100%);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #fff;
}

.login-hero-inner h1 {
  font-weight: 800;
  letter-spacing: .5px;
  margin-top: 1rem;
}

.login-hero .lead { opacity: .92; }

.login-logo { width: 96px; height: auto; filter: drop-shadow(0 6px 16px rgba(0,0,0,.25)); }
.login-logo-sm { width: 64px; height: auto; }

.login-points { list-style: none; padding: 0; margin-top: 1.5rem; }
.login-points li { margin: .55rem 0; display: flex; gap: .65rem; align-items: center; }
.login-points i { color: var(--sp-aksen); font-size: 1.15rem; }

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--sp-bg);
}

.login-card { width: 100%; max-width: 440px; border-radius: 18px; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; background: var(--sp-bg); }

.sidebar {
  width: var(--sidebar-w);
  background: #0b1f3a;
  color: #e8eef8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 1040;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.brand-title { font-weight: 800; font-size: .95rem; letter-spacing: .4px; }
.brand-sub { font-size: .72rem; color: #9db4d4; }

.sidebar-nav { padding: .75rem .55rem; flex: 1; overflow: auto; }

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #c9d7ea;
  text-decoration: none;
  padding: .62rem .75rem;
  border-radius: 10px;
  margin-bottom: .2rem;
  font-size: .92rem;
  transition: background .15s, color .15s;
}

.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav .nav-item.active {
  background: var(--sp-biru);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(26, 115, 232, .35);
}

/* Submenu (mis. Pelanggan: Daftar, Import, Export, Formulir) */
.nav-group .nav-caret { margin-left: auto; font-size: .7rem; transition: transform .15s; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; padding: .1rem 0 .3rem 2.4rem; }
.nav-group.open .nav-sub { display: block; }
.nav-sub-item {
  display: block;
  color: #9db4d4;
  text-decoration: none;
  font-size: .84rem;
  padding: .4rem .6rem;
  border-radius: 8px;
  margin-bottom: .1rem;
}
.nav-sub-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-sub-item.active { color: #fff; font-weight: 600; background: rgba(26,115,232,.35); }

.sidebar-foot { padding: .85rem; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; gap: .65rem; align-items: center; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sp-aksen); color: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.user-name { font-size: .85rem; font-weight: 600; }
.user-role { font-size: .72rem; color: #9db4d4; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.navbar-top {
  background: var(--sp-card);
  border-bottom: 1px solid #e6edf7;
  padding: .7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(15,40,80,.04);
}

.navbar-title { font-weight: 700; color: var(--sp-text); flex: 1; }
.navbar-actions { display: flex; align-items: center; gap: .5rem; }

.content { padding: 1.15rem 1.25rem 2rem; flex: 1; }

.app-footer {
  padding: .75rem 1.25rem;
  color: var(--sp-abu);
  font-size: .8rem;
  border-top: 1px solid #e6edf7;
  background: var(--sp-card);
}

/* Stat cards */
.stat-card {
  background: var(--sp-card);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  padding: .95rem 1rem;
  height: 100%;
  border-left: 4px solid var(--sp-biru);
}
.stat-card.ok { border-left-color: #16a34a; }
.stat-card.warn { border-left-color: var(--sp-aksen); }
.stat-card.danger { border-left-color: #dc2626; }
.stat-card.accent { border-left-color: #7c3aed; }
.stat-label { font-size: .75rem; color: var(--sp-abu); text-transform: uppercase; letter-spacing: .3px; }
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--sp-text); line-height: 1.2; margin: .2rem 0; }
.stat-value.stat-money { font-size: 1.15rem; }
.stat-sub { font-size: .75rem; color: var(--sp-abu); }
.stat-link { font-size: .75rem; color: var(--sp-biru); text-decoration: none; }
.stat-link:hover { text-decoration: underline; }

.card {
  border: 0;
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
}
.card-header { border-bottom: 1px solid #eef2f8; border-radius: var(--sp-radius) var(--sp-radius) 0 0 !important; }

.table > :not(caption) > * > * { padding: .55rem .65rem; }

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .login-wrap { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: .9rem; }
  .stat-value { font-size: 1.25rem; }
}

@media print {
  .sidebar, .navbar-top, .app-footer, .btn, .no-print { display: none !important; }
  .content { padding: 0; }
  .card, .stat-card { box-shadow: none; border: 1px solid #ddd; }
  body, .app-shell, .app-main, .content { background: #fff; display: block; }
  .print-head { display: block !important; }
}

.print-head {
  display: none;
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #222;
}
.print-head img { max-height: 56px; }
