/* ============================================================
   SIPMA — Stylesheet Responsif
   Mobile-first, breakpoints: sm=480, md=768, lg=1024, xl=1280
   ============================================================ */

/* -------------------------------------------------------
   CSS Variables & Reset
   ------------------------------------------------------- */
:root {
  /* Biru inti — sedikit lebih dalam & tegas dari biru default */
  --primary:       #1f4fd8;
  --primary-dark:  #1739a8;
  --primary-light: #eaf0ff;

  --success:       #047857;
  --success-bg:    #e7f6f0;
  --warning:       #b45309;
  --warning-bg:    #fdf3e3;
  --danger:        #b91c1c;
  --danger-bg:     #fdeaea;
  --info:          #1f4fd8;
  --info-bg:       #eaf0ff;

  /* Warna modul — mengkodekan konteks, bukan hiasan */
  --mod-rencana:   #1f4fd8;   /* TP & ATP, RPP PM   */
  --mod-analisis:  #7c3aed;   /* Analisis & perbaikan */
  --mod-supervisi: #0f766e;   /* Supervisi akademik  */
  --mod-kelola:    #b45309;   /* Admin & wilayah     */

  /* Netral bernuansa kertas — SIPMA mengurus dokumen */
  --gray-50:  #f7f8fa;
  --gray-100: #eef0f4;
  --gray-200: #e2e5ec;
  --gray-300: #cbd0da;
  --gray-400: #98a0ae;
  --gray-500: #6b7382;
  --gray-600: #4b5261;
  --gray-700: #343b49;
  --gray-800: #212836;
  --gray-900: #141a26;
  --paper:    #ffffff;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  22px;

  /* Bayangan berlapis tipis — terasa seperti kertas, bukan kotak melayang */
  --shadow-sm:  0 1px 2px rgba(20,26,38,.05), 0 1px 1px rgba(20,26,38,.03);
  --shadow-md:  0 2px 4px rgba(20,26,38,.04), 0 8px 20px -6px rgba(20,26,38,.10);
  --shadow-lg:  0 4px 8px rgba(20,26,38,.05), 0 18px 40px -12px rgba(20,26,38,.16);
  --ring:       0 0 0 3px rgba(31,79,216,.18);

  --topnav-h:    62px;
  --bottom-nav-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: var(--font); }

/* -------------------------------------------------------
   Utility
   ------------------------------------------------------- */
.d-none   { display: none !important; }
.d-desktop { display: none !important; }
.d-mobile  { display: block !important; }
.d-mobile-flex { display: flex !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }

@media (min-width: 768px) {
  .d-desktop { display: flex !important; }
  .d-mobile  { display: none !important; }
  .d-mobile-flex { display: none !important; }
}

/* -------------------------------------------------------
   Flash Messages
   ------------------------------------------------------- */
.flash-container {
  position: fixed; top: 70px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px);
}
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  background: #fff; box-shadow: var(--shadow-md);
  border-left: 4px solid var(--gray-300);
  animation: slideIn .2s ease;
  min-width: 260px;
}
.flash-success { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.flash-error   { border-color: var(--danger);  background: var(--danger-bg);  color: var(--danger); }
.flash-warning { border-color: #d97706; background: var(--warning-bg); color: var(--warning); }
.flash-info    { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.flash-close { background: none; border: none; cursor: pointer; font-size: 14px; opacity: .7; padding: 0 4px; }
@keyframes slideIn { from { transform: translateX(20px); opacity:0; } to { transform: none; opacity:1; } }

/* -------------------------------------------------------
   Top Navigation
   ------------------------------------------------------- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topnav-h);
  background: #fff; border-bottom: 1px solid var(--gray-200);
  z-index: 1000; box-shadow: var(--shadow-sm);
}
.topnav-inner {
  display: flex; align-items: center; gap: 16px;
  height: 100%; padding: 0 16px; max-width: 1280px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--gray-900); font-weight: 700;
}
.brand-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 18px;
}
.brand-name { font-size: 18px; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; margin-left: 16px; }
.nav-link {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--gray-600);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary); }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Nav icon button */
.nav-icon-btn {
  position: relative; padding: 8px; border-radius: var(--radius-sm);
  font-size: 18px; color: var(--gray-600); cursor: pointer;
  display: flex; align-items: center; text-decoration: none;
}
.nav-icon-btn:hover { background: var(--gray-100); }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; border-radius: 10px;
  padding: 1px 4px; min-width: 16px; text-align: center;
  line-height: 14px;
}

/* User menu */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: var(--radius-md);
  background: none; border: 1px solid var(--gray-200);
  cursor: pointer; transition: background .15s;
}
.user-menu-trigger:hover { background: var(--gray-100); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-avatar-initials {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.chevron { font-size: 10px; color: var(--gray-400); }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px; background: #fff;
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); z-index: 100;
  display: none; overflow: hidden;
}
.user-dropdown.open { display: block; }
.dropdown-header {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  display: flex; flex-direction: column; gap: 2px;
}
.dropdown-header strong { font-size: 14px; }
.dropdown-header small { font-size: 12px; color: var(--gray-500); }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 14px; color: var(--gray-700);
  transition: background .15s; cursor: pointer;
}
.dropdown-item:hover { background: var(--gray-50); text-decoration: none; }
.dropdown-item.text-danger { color: var(--danger); }

/* Role badge */
.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; width: fit-content;
}
.role-guru       { background: #e0f2fe; color: #0369a1; }
.role-supervisor { background: #ede9fe; color: #6d28d9; }
.role-admin      { background: #fce7f3; color: #be185d; }

/* Hamburger */
.hamburger {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px; background: none; border: none; cursor: pointer;
}
.hamburger span {
  width: 20px; height: 2px; background: var(--gray-700);
  border-radius: 2px; transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* -------------------------------------------------------
   Mobile Drawer
   ------------------------------------------------------- */
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 1100;
  backdrop-filter: blur(2px);
}
.mobile-overlay.open { display: block; }
.mobile-drawer {
  position: fixed; top: 0; left: -280px; bottom: 0;
  width: 280px; background: #fff; z-index: 1200;
  transition: left .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.mobile-drawer.open { left: 0; }
.drawer-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px; background: var(--primary);
  color: #fff;
}
.drawer-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.drawer-avatar-initials {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.25); color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drawer-header strong { font-size: 15px; display: block; }
.drawer-header small  { font-size: 12px; opacity: .8; }
.drawer-nav { padding: 8px 0; }
.drawer-link {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; font-size: 15px; font-weight: 500;
  color: var(--gray-700); transition: background .15s;
}
.drawer-link:hover, .drawer-link.active {
  background: var(--gray-50); color: var(--primary);
  text-decoration: none;
}
.drawer-link.text-danger { color: var(--danger); }
.badge-small {
  background: var(--danger); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
}

/* -------------------------------------------------------
   Bottom Navigation
   ------------------------------------------------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: #fff; border-top: 1px solid var(--gray-200);
  z-index: 999; display: flex; box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--gray-500); text-decoration: none;
  padding: 6px 4px; position: relative;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { text-decoration: none; }
.bn-icon { font-size: 20px; position: relative; }
.bn-label { font-size: 10px; font-weight: 500; }
.badge-dot-sm {
  position: absolute; top: -2px; right: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}

/* -------------------------------------------------------
   Main Content
   ------------------------------------------------------- */
.app-main {
  padding-top: var(--topnav-h);
  min-height: 100vh;
}
.app-main.has-bottom-nav {
  padding-bottom: var(--bottom-nav-h);
}
.container {
  max-width: 1280px; margin: 0 auto;
  padding: 20px 16px;
}
@media (min-width: 768px) {
  .container { padding: 28px 24px; }
}

/* -------------------------------------------------------
   Page Header
   ------------------------------------------------------- */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--gray-500); }
@media (min-width: 768px) {
  .page-title { font-size: 24px; }
}

/* -------------------------------------------------------
   Cards
   ------------------------------------------------------- */
.card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-body { padding: 16px; }
.card-header {
  padding: 14px 16px; border-bottom: 1px solid var(--gray-100);
  font-size: 15px; font-weight: 600; color: var(--gray-800);
  display: flex; align-items: center; justify-content: space-between;
}
@media (min-width: 768px) {
  .card-body { padding: 20px; }
  .card-header { padding: 16px 20px; }
}

/* -------------------------------------------------------
   Stats Grid
   ------------------------------------------------------- */
.stats-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 16px;
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.stat-card.highlight { border-color: var(--primary); background: var(--primary-light); }
.stat-card.highlight .stat-value { color: var(--primary); }
@media (min-width: 768px) {
  .stat-value { font-size: 36px; }
}

/* -------------------------------------------------------
   Grid Layouts
   ------------------------------------------------------- */
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* -------------------------------------------------------
   Forms
   ------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 11px 14px; font-size: 14px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-md);
  background: #fff; color: var(--gray-800);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; gap: 12px; }
@media (min-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-lg);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--gray-50);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-title { font-size: 15px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.upload-subtitle { font-size: 13px; color: var(--gray-400); }

/* -------------------------------------------------------
   Buttons
   ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; border: none;
  cursor: pointer; transition: all .15s;
  text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline {
  background: transparent; color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-100); }
.btn-ghost  { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 13px 28px; font-size: 16px; min-height: 52px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Loading state */
.btn-loading::after {
  content: ''; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------
   Badges
   ------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--primary-light); color: var(--primary); }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }

/* -------------------------------------------------------
   Tables (scrollable on mobile)
   ------------------------------------------------------- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th {
  padding: 11px 14px; text-align: left; font-size: 12px;
  font-weight: 600; color: var(--gray-500); text-transform: uppercase;
  letter-spacing: .04em; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* -------------------------------------------------------
   Score Display
   ------------------------------------------------------- */
.score-ring-wrap { text-align: center; }
.score-big { font-size: 56px; font-weight: 700; line-height: 1; color: var(--gray-900); }
.score-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

.progress-bar {
  height: 8px; border-radius: 8px;
  background: var(--gray-200); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 8px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-fill.success { background: #10b981; }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger  { background: #ef4444; }

.dimension-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 14px;
}
.dimension-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 8px;
}
.dimension-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.dimension-score { font-size: 16px; font-weight: 700; }
.dimension-note { font-size: 12px; color: var(--gray-500); margin-top: 6px; line-height: 1.5; }

/* Recommendation */
.rec-item {
  border-left: 3px solid var(--gray-300); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px; background: #fff;
  border-top: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 8px;
}
.rec-item.warning { border-left-color: #f59e0b; }
.rec-item.success { border-left-color: #10b981; }
.rec-item.danger  { border-left-color: #ef4444; }
.rec-title { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 3px; }
.rec-text  { font-size: 12px; color: var(--gray-500); line-height: 1.5; }

/* -------------------------------------------------------
   Loading Overlay (saat analisis AI)
   ------------------------------------------------------- */
.ai-loading {
  display: none; position: fixed; inset: 0;
  background: rgba(255,255,255,.92); z-index: 9000;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  backdrop-filter: blur(4px);
}
.ai-loading.show { display: flex; }
.ai-spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
.ai-loading-text { font-size: 15px; font-weight: 600; color: var(--gray-700); }
.ai-loading-sub  { font-size: 13px; color: var(--gray-400); }

/* -------------------------------------------------------
   Tabs
   ------------------------------------------------------- */
.tabs { border-bottom: 1px solid var(--gray-200); display: flex; gap: 0; margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  color: var(--gray-500); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  white-space: nowrap; transition: color .15s;
}
.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* -------------------------------------------------------
   RPP List (mobile card-style)
   ------------------------------------------------------- */
.rpp-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: box-shadow .15s;
}
.rpp-card:hover { box-shadow: var(--shadow-sm); text-decoration: none; }
.rpp-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary-light); display: flex;
  align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.rpp-card-info { flex: 1; min-width: 0; }
.rpp-card-title {
  font-size: 14px; font-weight: 600; color: var(--gray-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rpp-card-meta { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.rpp-card-score { flex-shrink: 0; text-align: center; }

/* -------------------------------------------------------
   Google Login Button
   ------------------------------------------------------- */
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 24px; border-radius: var(--radius-md);
  background: #fff; border: 1.5px solid var(--gray-300);
  font-size: 15px; font-weight: 600; color: var(--gray-700);
  cursor: pointer; transition: all .15s; width: 100%;
  min-height: 52px; text-decoration: none; box-shadow: var(--shadow-sm);
}
.btn-google:hover { background: var(--gray-50); box-shadow: var(--shadow-md); text-decoration: none; }

/* -------------------------------------------------------
   Landing Page
   ------------------------------------------------------- */
.landing-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #fff 100%);
  padding: 32px 16px;
}
.landing-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl); padding: 32px 24px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.landing-logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--primary); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.landing-title { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.landing-subtitle { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.landing-desc { font-size: 12px; color: var(--gray-400); margin-bottom: 28px; }
.landing-features {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 24px; text-align: left;
}
.feature-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; background: var(--gray-50);
  border-radius: var(--radius-md); font-size: 13px;
}
.feature-icon { font-size: 18px; flex-shrink: 0; }
.feature-text strong { display: block; font-size: 13px; color: var(--gray-800); }
.feature-text span   { font-size: 12px; color: var(--gray-500); }

/* -------------------------------------------------------
   Pending approval page
   ------------------------------------------------------- */
.pending-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 32px 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #fff 100%);
}
.pending-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl); padding: 32px 24px;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg);
}

/* -------------------------------------------------------
   Footer
   ------------------------------------------------------- */
.app-footer {
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 8px; font-size: 12px; color: var(--gray-400);
  border-top: 1px solid var(--gray-200); margin-top: 32px;
}

/* -------------------------------------------------------
   Responsive Tweaks
   ------------------------------------------------------- */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 24px; }
  .score-big { font-size: 44px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  .card-body { padding: 14px; }
  table { min-width: 420px; font-size: 13px; }
  th, td { padding: 10px 12px; }
}

@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}


/* ============================================================
   LAPISAN MODERN — SIPMA v2
   Sistem: kertas tenang + tulang punggung warna per modul.
   Warna mengkodekan modul (rencana / analisis / supervisi /
   kelola) sehingga pengguna tahu di mana dirinya berada.
   ============================================================ */

body {
  background:
    radial-gradient(1100px 420px at 88% -8%, rgba(31,79,216,.05), transparent 60%),
    radial-gradient(820px 360px at -6% 4%, rgba(124,58,237,.045), transparent 62%),
    var(--gray-50);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
}

/* Angka selalu rata lebarnya supaya kolom statistik tidak goyang */
.stat-value, .score-big, .dimension-score, table td, table th, .badge { font-variant-numeric: tabular-nums; }

/* ---------- Bilah atas ---------- */
.topnav {
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: none;
}
.brand-name { font-weight: 800; letter-spacing: -.03em; }
.brand-icon { border-radius: 11px; box-shadow: var(--shadow-sm); }

.nav-link {
  position: relative;
  border-radius: 10px;
  padding: 8px 13px;
  font-weight: 600;
  color: var(--gray-600);
  transition: background .18s ease, color .18s ease;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-800); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-link.active::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--primary);
}

/* ---------- Kartu ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.card-header { border-bottom: 1px solid var(--gray-100); padding: 16px 20px; }
.card-body   { padding: 20px; }

/* Tulang punggung modul: .card.m-rencana / .m-analisis / .m-supervisi / .m-kelola */
.card[class*="m-"] { position: relative; overflow: hidden; }
.card[class*="m-"]::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.card.m-rencana::before   { background: var(--mod-rencana); }
.card.m-analisis::before  { background: var(--mod-analisis); }
.card.m-supervisi::before { background: var(--mod-supervisi); }
.card.m-kelola::before    { background: var(--mod-kelola); }

/* ---------- Statistik ---------- */
.stats-grid { gap: 12px; }
.stat-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), rgba(31,79,216,0));
  opacity: .85;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.stat-card.highlight { border-color: rgba(31,79,216,.35); background: linear-gradient(180deg, var(--primary-light), var(--paper) 58%); }
.stat-value {
  font-size: clamp(26px, 4.4vw, 34px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
  color: var(--gray-900);
}
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gray-400); margin-top: 5px;
}

/* ---------- Tombol ---------- */
.btn {
  border-radius: 10px;
  font-weight: 650;
  letter-spacing: -.01em;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: 0 1px 2px rgba(20,26,38,.08), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-outline { border: 1px solid var(--gray-300); background: var(--paper); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { border-radius: 9px; }

/* ---------- Formulir ---------- */
.form-label { font-size: 12.5px; font-weight: 650; color: var(--gray-700); letter-spacing: -.01em; }
.form-control {
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:hover { border-color: var(--gray-400); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
select.form-control {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7382' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}

/* ---------- Tab ---------- */
.tabs { gap: 2px; border-bottom: 1px solid var(--gray-200); }
.tab-btn {
  border-radius: 10px 10px 0 0;
  font-weight: 650;
  color: var(--gray-500);
  padding: 11px 15px;
  transition: color .16s ease, background .16s ease;
}
.tab-btn:hover { color: var(--gray-800); background: var(--gray-100); text-decoration: none; }
.tab-btn.active { color: var(--primary); background: transparent; }

/* ---------- Lencana ---------- */
.badge {
  border-radius: 999px;
  font-weight: 650;
  font-size: 11px;
  letter-spacing: .01em;
  padding: 4px 10px;
}

/* ---------- Tabel ---------- */
.table-wrapper { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); }
.table-wrapper table { border-collapse: separate; border-spacing: 0; }
.table-wrapper thead th {
  background: var(--gray-50);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  padding: 11px 14px;
}
.table-wrapper tbody td { border-bottom: 1px solid var(--gray-100); padding: 12px 14px; }
.table-wrapper tbody tr:last-child td { border-bottom: none; }
.table-wrapper tbody tr { transition: background .14s ease; }
.table-wrapper tbody tr:hover { background: var(--gray-50); }

/* ---------- Judul halaman ---------- */
.page-title {
  font-weight: 800;
  letter-spacing: -.035em;
  color: var(--gray-900);
}
.page-subtitle { color: var(--gray-500); font-size: 13.5px; }

/* ---------- Kartu RPP ---------- */
.rpp-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.rpp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.rpp-card-title { font-weight: 700; letter-spacing: -.015em; }
.rpp-card-icon { border-radius: 12px; }

/* ---------- Bilah kemajuan ---------- */
.progress-bar { background: var(--gray-200); border-radius: 999px; overflow: hidden; }
.progress-fill { border-radius: 999px; transition: width .8s cubic-bezier(.22,.85,.3,1); }

/* ---------- Navigasi bawah (ponsel) ---------- */
.bottom-nav {
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--gray-200);
}
.bottom-nav-item { color: var(--gray-500); transition: color .16s ease; }
.bottom-nav-item.active { color: var(--primary); }
.bn-label { font-weight: 650; letter-spacing: -.01em; }

/* ---------- Pesan kilat ---------- */
.flash {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  font-weight: 550;
}

/* ---------- Keadaan kosong ---------- */
.empty-state { text-align: center; padding: 44px 20px; }
.empty-state .es-mark {
  width: 54px; height: 54px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 16px; background: var(--gray-100); font-size: 24px;
}
.empty-state .es-title { font-size: 15px; font-weight: 700; color: var(--gray-700); }
.empty-state .es-desc  { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

/* ---------- Rangka muat ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
  border-radius: 8px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Muncul saat gulir ---------- */
.reveal { opacity: 0; transform: translateY(10px); animation: rv .45s cubic-bezier(.22,.85,.3,1) forwards; }
.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .1s; }
.reveal:nth-child(4) { animation-delay: .15s; }
@keyframes rv { to { opacity: 1; transform: none; } }

/* ---------- Aksesibilitas ---------- */
a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Cetak ---------- */
@media print {
  body { background: #fff; }
  .topnav, .bottom-nav, .app-footer, .no-print { display: none !important; }
  .card { box-shadow: none; border-color: #d1d5db; break-inside: avoid; }
  .app-main { padding-top: 0 !important; }
}

/* ============================================================
   KERANGKA SIDEBAR + KOMPONEN DASBOR — SIPMA v3
   ============================================================ */

.sidebar { display: none; }

@media (min-width: 1024px) {
  .topnav { display: none; }

  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0;
    width: 254px; padding: 20px 14px 16px;
    background: linear-gradient(178deg, #1b2440 0%, #141c34 55%, #111829 100%);
    color: #cfd7ea;
    overflow-y: auto;
    z-index: 90;
  }
  .sidebar::-webkit-scrollbar { width: 5px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }

  .app-main { padding-top: 26px !important; margin-left: 254px; }
  .app-main.has-bottom-nav { padding-bottom: 40px !important; }
  .app-footer { margin-left: 254px; }
  .container { padding-left: 26px; padding-right: 26px; }
}

/* Merek */
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; text-decoration: none; }
.sb-brand:hover { text-decoration: none; }
.sb-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(140deg, #3b6ef0, #7c3aed);
  border-radius: 11px; box-shadow: 0 6px 16px -4px rgba(59,110,240,.55);
}
.sb-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1.1; }
.sb-tag  { font-size: 10.5px; color: #7f8bad; letter-spacing: .02em; }

/* Kartu pengguna */
.sb-user {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px; padding: 10px 11px; margin-bottom: 18px;
}
.sb-ava { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.sb-ava-txt {
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, #3b6ef0, #7c3aed);
}
.sb-uname { font-size: 13.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-urole { font-size: 10.5px; color: #7f8bad; }

/* Navigasi */
.sb-nav { flex: 1; }
.sb-grup {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #6c789b; padding: 14px 10px 7px;
}
.sb-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: #b6c0da;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.sb-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sb-link.on { background: rgba(255,255,255,.11); color: #fff; }
.sb-link.on::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: #6f8cff;
}
.sb-link.m-rencana.on::before   { background: #6f8cff; }
.sb-link.m-analisis.on::before  { background: #a78bfa; }
.sb-link.m-supervisi.on::before { background: #2dd4bf; }
.sb-link.m-kelola.on::before    { background: #fbbf24; }
.sb-ikon { font-size: 15px; width: 19px; text-align: center; flex-shrink: 0; }
.sb-hitung {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: #ef4444; color: #fff; padding: 1px 7px; border-radius: 9px;
}

.sb-kaki { border-top: 1px solid rgba(255,255,255,.09); padding-top: 10px; margin-top: 12px; }
.sb-keluar { color: #f4a3a3; }
.sb-keluar:hover { background: rgba(239,68,68,.14); color: #fecaca; }

/* ---------- Sapaan besar ---------- */
.sapa { margin-bottom: 22px; }
.sapa-halo { font-size: 13.5px; color: var(--gray-500); font-weight: 550; }
.sapa-judul {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 800; letter-spacing: -.04em; line-height: 1.12;
  color: var(--gray-900); margin-top: 2px;
}
.sapa-sub { font-size: 13.5px; color: var(--gray-500); margin-top: 5px; }

/* ---------- Ubin aksi berwarna ---------- */
.ubin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; }
.ubin {
  position: relative; overflow: hidden;
  display: block; padding: 18px; border-radius: var(--radius-xl);
  color: #fff; text-decoration: none;
  min-height: 128px;
  transition: transform .2s cubic-bezier(.22,.85,.3,1), box-shadow .2s ease;
}
.ubin:hover { transform: translateY(-3px); text-decoration: none; box-shadow: var(--shadow-lg); }
.ubin::after {
  content: ''; position: absolute; right: -32px; bottom: -42px;
  width: 128px; height: 128px; border-radius: 50%;
  background: rgba(255,255,255,.13);
}
.ubin-ikon { font-size: 25px; margin-bottom: 26px; display: block; position: relative; z-index: 1; }
.ubin-judul { font-size: 15.5px; font-weight: 750; letter-spacing: -.02em; position: relative; z-index: 1; }
.ubin-sub { font-size: 12px; opacity: .82; margin-top: 2px; position: relative; z-index: 1; }
.ubin-biru   { background: linear-gradient(140deg, #3b6ef0, #2347c4); }
.ubin-ungu   { background: linear-gradient(140deg, #8b5cf6, #6d28d9); }
.ubin-teal   { background: linear-gradient(140deg, #14b8a6, #0d7d72); }
.ubin-amber  { background: linear-gradient(140deg, #f59e0b, #c2660a); }
.ubin-terang { background: var(--paper); color: var(--gray-800); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.ubin-terang::after { background: var(--gray-100); }

/* ---------- Cincin donat ---------- */
.donat { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.donat svg { transform: rotate(-90deg); display: block; }
.donat-isi {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.donat-angka { font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.donat-label { font-size: 11px; color: var(--gray-400); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; margin-top: 5px; }
.donat-jalur { stroke: var(--gray-200); }
.donat-nilai { stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.22,.85,.3,1); }

/* ---------- Daftar aktivitas ---------- */
.akt { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--gray-100); }
.akt:last-child { border-bottom: none; }
.akt-ikon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center; font-size: 16px; background: var(--gray-100);
}
.akt-isi { flex: 1; min-width: 0; }
.akt-judul { font-size: 13.5px; font-weight: 650; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.akt-meta { font-size: 11.5px; color: var(--gray-400); margin-top: 1px; }
.akt-nilai { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- Bagian dua kolom ---------- */
.dua-kolom { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .dua-kolom { grid-template-columns: 1fr; } }

.judul-bagian {
  font-size: 16px; font-weight: 750; letter-spacing: -.03em;
  color: var(--gray-900); margin-bottom: 12px;
}
