/* ============================================================
   SIPANDU - Gaya Aplikasi (tema biru institusional)
   ============================================================ */
:root {
  --sp-navy: #0d2b45;
  --sp-navy-2: #123a5f;
  --sp-primary: #0b5394;
  --sp-primary-dark: #083d6f;
  --sp-accent: #f4a825;
  --sp-bg: #f2f5f9;
}

body { background: var(--sp-bg); font-size: .925rem; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 248px; background: linear-gradient(180deg, var(--sp-navy) 0%, #081c2e 100%);
  color: #cfe0f3; z-index: 1040; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.sidebar-brand { display: flex; gap: .75rem; align-items: center; padding: 1rem 1rem .9rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.brand-name { color: #fff; font-weight: 700; letter-spacing: .06em; }
.brand-sub { font-size: .66rem; color: #9db6d3; line-height: 1.2; max-width: 170px; }
.sidebar-scroll { overflow-y: auto; flex: 1 1 auto; padding-bottom: .5rem; }
.menu-group {
  font-size: .64rem; text-transform: uppercase; letter-spacing: .12em;
  color: #7f9ab8; padding: .9rem 1.1rem .25rem; font-weight: 700;
}
.menu-item {
  display: flex; align-items: center; gap: .65rem; color: #cfe0f3;
  padding: .5rem 1.1rem; text-decoration: none; font-size: .875rem;
  border-left: 3px solid transparent;
}
.menu-item i { font-size: 1rem; width: 18px; text-align: center; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.active { background: rgba(244,168,37,.12); border-left-color: var(--sp-accent); color: #fff; font-weight: 600; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: .8rem 0 .6rem; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto;
}
.sidebar-user-role { font-size: .66rem; color: #9db6d3; line-height: 1.25; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035;
  }
}

/* ---------- Konten ---------- */
.main-content { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
@media (max-width: 991.98px) { .main-content { margin-left: 0; } }
.topbar {
  background: #fff; border-bottom: 1px solid #e3e9f2; padding: .6rem 1rem;
  display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1020;
}
.topbar-title { color: #33475e; }
.topbar-user { color: #33475e; font-weight: 600; }
.content { flex: 1 1 auto; }
.app-footer {
  padding: .8rem 1.2rem; border-top: 1px solid #e3e9f2; color: #64778e;
  background: #fff; font-size: .8rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- Kartu ---------- */
.card { border: none; box-shadow: 0 1px 3px rgba(13,43,69,.08), 0 1px 2px rgba(13,43,69,.05); border-radius: .8rem; }
.card-header { background: #fff; border-bottom: 1px solid #edf1f7; font-weight: 600; color: #33475e; border-radius: .8rem .8rem 0 0 !important; }
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 1.35rem; flex: 0 0 auto;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .78rem; color: #64778e; text-transform: uppercase; letter-spacing: .04em; }

.bg-ico-blue   { background: #e3effb; color: var(--sp-primary); }
.bg-ico-green  { background: #e2f5e9; color: #198754; }
.bg-ico-amber  { background: #fdf3dd; color: #b8860b; }
.bg-ico-red    { background: #fde8e8; color: #bb2d3b; }
.bg-ico-navy   { background: #e2e8f0; color: var(--sp-navy); }

/* ---------- IEP Hero ---------- */
.iep-hero { background: linear-gradient(135deg, var(--sp-navy) 0%, var(--sp-primary-dark) 60%, var(--sp-primary) 100%); color: #fff; border-radius: .8rem; }
.iep-hero .iep-value { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.iep-hero .progress { background: rgba(255,255,255,.2); }
.iep-scale { display: flex; justify-content: space-between; font-size: .68rem; color: #cfe0f3; }

/* ---------- Tabel ---------- */
.table { --bs-table-hover-bg: #f6f9fd; }
.table thead th {
  background: #f4f7fb; color: #33475e; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid #e3e9f2; white-space: nowrap;
}
.table td { vertical-align: middle; }

/* ---------- Heatmap ---------- */
td.heat-1, .heat-1 { background: #c9e9d3 !important; color: #0f5132 !important; font-weight: 700; }
td.heat-2, .heat-2 { background: #dff0d5 !important; color: #3c763d !important; font-weight: 600; }
td.heat-3, .heat-3 { background: #fcf3cf !important; color: #8a6d00 !important; font-weight: 600; }
td.heat-4, .heat-4 { background: #fbe0cd !important; color: #935116 !important; font-weight: 600; }
td.heat-5, .heat-5 { background: #f5c6cb !important; color: #8b1a24 !important; font-weight: 700; }
td.heat-na { color: #97a5b5; }

/* ---------- Matriks risiko 5x5 (Skor = L x S) ---------- */
.risk-matrix { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.risk-matrix th, .risk-matrix td { text-align: center; padding: 0; }
.rm-axis-x {
  font-weight: 700; color: #33475e; font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; padding-bottom: 3px;
}
.rm-axis-y { width: 26px; }
.rm-axis-y span {
  writing-mode: vertical-rl; transform: rotate(180deg); margin: 0 auto;
  font-weight: 700; color: #33475e; font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
}
.rm-head { width: 30px; font-weight: 700; color: #33475e; font-size: .85rem; padding: 2px 0 !important; }
.rm-cell {
  border-radius: 6px; height: 58px; vertical-align: middle;
  border: 1px solid rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px rgba(0,0,0,.07);
}
.rm-score { font-size: 1.02rem; font-weight: 800; line-height: 1.15; }
.rm-codes {
  font-size: .58rem; font-weight: 600; line-height: 1.2; opacity: .9; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rm-low  { background: #6dbd72; color: #0d3a13; }
.rm-med  { background: #ffd34d; color: #58430a; }
.rm-high { background: #e4605f; color: #4c0b0d; }
.rm-legend { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; }
.rm-chip {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .74rem; font-weight: 700;
  color: #33475e; background: #f4f7fb; border: 1px solid #e3e9f2; border-radius: 999px; padding: .24rem .7rem;
}
.rm-chip i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.chip-low i  { background: #6dbd72; }
.chip-med i  { background: #ffd34d; }
.chip-high i { background: #e4605f; }
.rm-score-badge {
  font-size: .72rem; font-weight: 700; color: #33475e; background: #f4f7fb;
  border: 1px solid #e3e9f2; border-radius: 999px; padding: .18rem .65rem; white-space: nowrap;
}

/* ---------- Siklus pengawasan ---------- */
.cycle-step { display: flex; gap: .8rem; align-items: flex-start; }
.cycle-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--sp-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; background: linear-gradient(135deg, var(--sp-navy) 0%, var(--sp-primary-dark) 55%, var(--sp-primary) 100%);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.login-card { width: 100%; max-width: 430px; border-radius: 1rem; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.login-head { background: var(--sp-navy); color: #fff; padding: 1.6rem 1.5rem 1.2rem; text-align: center; }
.login-head .brand-logo { margin: 0 auto .7rem; width: 56px; height: 56px; font-size: 1.9rem; }

/* ---------- Cetak ---------- */
.print-body { background: #fff; font-size: .92rem; }
.print-container { max-width: 960px; }
.print-letterhead { border-bottom: 3px double #333; padding-bottom: .8rem; margin-bottom: 1.4rem; }
.print-logo { height: 62px; margin-bottom: .45rem; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.lh-line1 { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.lh-line2 { font-size: .85rem; color: #444; }
.lh-line3 { margin-top: .55rem; font-weight: 700; font-size: 1rem; color: var(--sp-primary-dark); }
.ttd-row { page-break-inside: avoid; }
@media print {
  .no-print { display: none !important; }
  .print-container { max-width: 100%; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ---------- Utilitas ---------- */
.text-justify-p { text-align: justify; }
.small-note { font-size: .75rem; color: #64778e; }
.chart-box { position: relative; }
.dropdown-menu { box-shadow: 0 6px 24px rgba(13,43,69,.15); border: none; }
.btn-primary { background: var(--sp-primary); border-color: var(--sp-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--sp-primary-dark); border-color: var(--sp-primary-dark); }
a { color: var(--sp-primary); }
.page-link { color: var(--sp-primary); }
.scroll-x { overflow-x: auto; }
.badge { font-weight: 600; }
.form-label { font-weight: 600; color: #33475e; font-size: .82rem; }
