/* ============================================================================
   PENA DESIGN SYSTEM — Tokens dari Referensi UI/UX + Light/Dark Theme
   ============================================================================ */
  :root {
    --sidebar-bg: #0F172A;
    --sidebar-border: #1E293B;
    --sidebar-text: #94A3B8;
    --sidebar-text-active: #FFFFFF;

    --canvas-bg: #F8FAFC;
    --surface-card: #FFFFFF;
    --surface-subtle: #F1F5F9;
    --surface-tint: #EFF6FF;
    --table-head-bg: #0F172A;
    --table-head-text: #FFFFFF;
    --table-hover: #F8FAFC;

    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-end: #3B82F6;

    --success: #10B981;
    --purple: #7C3AED;
    --amber: #F59E0B;
    --cyan: #0EA5E9;
    --danger: #EF4444;

    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --border-subtle: #E2E8F0;
    --border-input: #CBD5E1;

    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 10px 15px -5px rgba(15, 23, 42, 0.03);
    --shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.08);
    --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

    --radius-card: 14px;
    --radius-control: 8px;
    --radius-pill: 9999px;
  }

  [data-theme="dark"] {
    --sidebar-bg: #090D16;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #94A3B8;

    --canvas-bg: #0B1120;
    --surface-card: #111827;
    --surface-subtle: #1E293B;
    --surface-tint: rgba(37, 99, 235, 0.14);
    --table-head-bg: #1E293B;
    --table-head-text: #F8FAFC;
    --table-hover: rgba(255, 255, 255, 0.03);

    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --border-subtle: rgba(255, 255, 255, 0.10);
    --border-input: rgba(255, 255, 255, 0.16);

    --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.45);
  }

  /* Base & Typography */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    background-color: var(--canvas-bg);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  html.login-gate-open,
  body.login-gate-open {
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100dvh !important;
  }

  h1,
  h2,
  h3,
  h4,
  .kpi-value,
  .brand-title,
  .donut-center-num {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  }

  .tnum,
  td,
  .kpi-value,
  .leaderboard-score {
    font-variant-numeric: tabular-nums;
  }

  /* Accessibility Focus Ring */
  :focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  /* Top Thin Progress Bar */
  .top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    background: rgba(37, 99, 235, 0.15);
    overflow: hidden;
  }

  .top-progress-fill {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #2563EB, #38BDF8);
    animation: progressSlide 1.1s infinite ease-in-out;
  }

  @keyframes progressSlide {
    0% {
      transform: translateX(-100%);
    }

    100% {
      transform: translateX(300%);
    }
  }

  /* App Shell Layout */
  .app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    width: 100%;
  }

  /* Sidebar Desktop (260px penuh -> 76px mode ikon ringkas saat hamburger di sidebar aktif) */
  .app-sidebar {
    width: 260px;
    flex-shrink: 0;
    align-self: stretch;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s ease;
  }

  .sidebar-sticky-inner {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    padding: 14px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .sidebar-sticky-inner::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .btn-sidebar-hamburger {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #CBD5E1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .btn-sidebar-hamburger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
  }

  @media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar {
      width: 76px;
    }

    body.sidebar-collapsed .sidebar-sticky-inner {
      padding: 18px 12px;
      align-items: center;
    }

    body.sidebar-collapsed .sidebar-header {
      width: 100%;
      justify-content: center;
      padding: 2px 0 18px;
    }

    body.sidebar-collapsed .brand-wrap {
      display: none;
    }

    body.sidebar-collapsed .btn-sidebar-hamburger {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      background: rgba(59, 130, 246, 0.18);
      border-color: rgba(59, 130, 246, 0.40);
      color: #93C5FD;
    }

    body.sidebar-collapsed .sidebar-nav {
      width: 100%;
      align-items: center;
      gap: 8px;
    }

    body.sidebar-collapsed .sidebar-link {
      position: relative;
      width: 44px;
      height: 44px;
      min-height: 44px;
      padding: 0;
      justify-content: center;
    }

    body.sidebar-collapsed .sidebar-link > span:not(.nav-badge-amber) {
      display: none;
    }

    body.sidebar-collapsed .sidebar-link svg {
      flex-shrink: 0;
    }

    body.sidebar-collapsed .sidebar-group {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    body.sidebar-collapsed .sidebar-chevron {
      display: none;
    }

    body.sidebar-collapsed .sidebar-submenu {
      margin: 4px 0 0;
      padding: 4px 0 0;
      border-left: none;
      align-items: center;
      gap: 6px;
    }

    body.sidebar-collapsed .sidebar-sublink {
      width: 38px;
      height: 38px;
      min-height: 38px;
      padding: 0;
      justify-content: center;
      border-radius: 9px;
    }

    body.sidebar-collapsed .sidebar-sublink > span {
      display: none;
    }

    body.sidebar-collapsed .nav-badge-amber {
      position: absolute;
      top: 3px;
      right: 3px;
      margin-left: 0;
      padding: 1px 4px;
      font-size: 9px;
      line-height: 1.2;
      min-width: 15px;
      text-align: center;
    }

    body.sidebar-collapsed .sidebar-logout-wrap {
      width: 100%;
      display: flex;
      justify-content: center;
    }

    body.sidebar-collapsed .sidebar-logout-btn {
      width: 44px;
      height: 44px;
      min-height: 44px;
      padding: 0;
      justify-content: center;
    }

    body.sidebar-collapsed .sidebar-logout-btn span {
      display: none;
    }

    body.sidebar-collapsed .app-wm-sidebar {
      display: none !important;
    }
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px 14px;
  }

  .brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
    overflow: hidden;
  }

  .brand-logo img,
  .pin-gate-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .brand-title {
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .brand-version {
    font-size: 10px;
    font-weight: 700;
    color: #93C5FD;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 2px 7px;
    border-radius: 6px;
  }

  .brand-subtitle {
    display: block;
    font-size: 11px;
    color: #94A3B8;
    margin-top: 2px;
  }

  .btn-icon-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #E2E8F0;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: visible;
  }

  .sidebar-logout-wrap {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.09);
    color: #FCA5A5;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  }

  .sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
    color: #FFFFFF;
  }

  .btn-topbar-logout:hover {
    color: #DC2626 !important;
    border-color: rgba(220, 38, 38, 0.38) !important;
    background: rgba(239, 68, 68, 0.08) !important;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
  }

  .sidebar-link:hover {
    background-color: #1E293B;
    color: #F8FAFC;
  }

  .sidebar-link.active {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 8px 18px -4px rgba(37, 99, 235, 0.45);
  }

  .sidebar-group {
    display: flex;
    flex-direction: column;
  }

  .sidebar-dropdown-toggle {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
  }

  .sidebar-dropdown-toggle.has-active {
    background: rgba(37, 99, 235, 0.16);
    color: #FFFFFF;
    font-weight: 600;
  }

  .sidebar-chevron {
    margin-left: auto;
    transition: transform 0.18s ease;
    opacity: 0.78;
    flex-shrink: 0;
  }

  .sidebar-dropdown-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(180deg);
    opacity: 1;
  }

  .nav-badge-amber + .sidebar-chevron {
    margin-left: 6px;
  }

  .sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 3px 0 2px 15px;
    padding-left: 11px;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
  }

  .sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 9px;
    color: #94A3B8;
    text-decoration: none;
    font-weight: 500;
    font-size: 12.75px;
    transition: background-color 0.16s ease, color 0.16s ease;
  }

  .sidebar-sublink:hover {
    background-color: #1E293B;
    color: #F8FAFC;
  }

  .sidebar-sublink.active {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 6px 14px -4px rgba(37, 99, 235, 0.45);
  }

  .kpi-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  @media (max-width: 1199.98px) {
    .kpi-grid-4 {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }

  @media (max-width: 575.98px) {
    .kpi-grid-4 {
      grid-template-columns: 1fr !important;
    }
  }

  .nav-badge-amber {
    margin-left: auto;
    background: #F59E0B;
    color: #0F172A;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
  }

  .btn-topbar-theme {
    height: 40px;
    min-height: 40px;
    padding: 0 13px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-card);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.15s ease, transform 0.15s ease;
  }

  .btn-topbar-theme:hover {
    background-color: var(--surface-subtle);
    transform: translateY(-1px);
  }

  .dashboard-quote-banner {
    background: linear-gradient(135deg, var(--surface-card), var(--surface-tint));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: var(--shadow-card);
  }

  .dashboard-quote-text {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.4;
  }

  .quote-trophy {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .quote-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.04em;
  }

  .dot-emerald {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
  }

  /* Main Content Area (Ruang kanan 56px sebagai jalur bersih dock scroll cepat) */
  .app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 56px 28px 28px;
  }

  .page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
  }

  .topbar-left {
    flex: 1 1 280px;
    min-width: 0;
  }

  @media (min-width: 992px) {
    .page-topbar {
      flex-wrap: nowrap;
      align-items: center;
      gap: 16px;
    }

    .topbar-controls {
      flex-shrink: 0;
      flex-wrap: nowrap;
    }
  }

  .topbar-heading {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
  }

  .topbar-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
  }

  .sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: #ECFDF5;
    color: #065F46;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #A7F3D0;
  }

  [data-theme="dark"] .sync-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.3);
  }

  .sync-pill.offline {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
  }

  .dot-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    animation: pulseDot 2s infinite;
  }

  @keyframes pulseDot {

    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.45;
      transform: scale(0.85);
    }
  }

  .topbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .select-pill {
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 32px 6px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .btn-icon-primary {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    transition: transform 0.15s ease, filter 0.15s ease;
  }

  .btn-icon-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
  }

  /* 5 KPI Gradient Cards */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }

  .kpi-card {
    border-radius: var(--radius-card);
    padding: 18px 16px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .kpi-card:hover {
    transform: translateY(-2px);
  }

  .kpi-blue {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    box-shadow: 0 10px 22px -6px rgba(37, 99, 235, 0.35);
  }

  .kpi-emerald {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 10px 22px -6px rgba(16, 185, 129, 0.35);
  }

  .kpi-purple {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    box-shadow: 0 10px 22px -6px rgba(124, 58, 237, 0.35);
  }

  .kpi-amber {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    box-shadow: 0 10px 22px -6px rgba(245, 158, 11, 0.35);
  }

  .kpi-cyan {
    background: linear-gradient(135deg, #0EA5E9, #0284C7);
    box-shadow: 0 10px 22px -6px rgba(14, 165, 233, 0.35);
  }

  .kpi-icon-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .kpi-body {
    min-width: 0;
  }

  .kpi-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.92;
  }

  .kpi-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    margin: 2px 0;
  }

  .kpi-sub {
    display: block;
    font-size: 11px;
    opacity: 0.88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Surface Cards & Typography */
  .surface-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 20px;
    box-shadow: var(--shadow-card);
  }

  .section-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
  }

  .card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }

  .card-head-title {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin: 0;
  }

  .card-head-meta {
    font-size: 12px;
    color: var(--text-muted);
  }

  .card-foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--border-subtle);
  }

  .text-muted-sm {
    font-size: 12.5px;
    color: var(--text-muted);
  }

  .link-action {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
  }

  .link-action:hover {
    text-decoration: underline;
  }

  /* Charts & Legends */
  .donut-grid {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    min-width: 0;
  }

  .donut-grid.donut-grid-compact {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
  }

  .donut-canvas-wrap {
    position: relative;
    width: 118px;
    height: 118px;
    margin: 0 auto;
  }

  .donut-canvas-wrap.donut-sm {
    width: 108px;
    height: 108px;
  }

  .donut-center-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }

  .donut-center-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
  }

  .donut-center-sub {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  .donut-legend-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .donut-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    font-size: 11.5px;
    line-height: 1.25;
  }

  .donut-legend-item strong.tnum {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11.5px;
  }

  .legend-dot-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    color: var(--text-secondary);
  }

  .legend-dot-label.legend-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .legend-text-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .legend-title-main {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .legend-range-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .bar-canvas-wrap {
    position: relative;
    min-height: 200px;
  }

  /* Top 5 Leaderboard */
  .leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--canvas-bg);
    border: 1px solid var(--border-subtle);
  }

  .rank-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .rank-1 {
    background: #FEF3C7;
    color: #B45309;
  }

  .rank-2 {
    background: #E2E8F0;
    color: #334155;
  }

  .rank-3 {
    background: #FFEDD5;
    color: #C2410C;
  }

  .rank-other {
    background: var(--surface-subtle);
    color: var(--text-muted);
  }

  .leaderboard-score {
    font-size: 12.5px;
    font-weight: 700;
    color: #059669;
    background: #ECFDF5;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
  }

  [data-theme="dark"] .leaderboard-score {
    background: rgba(16, 185, 129, 0.16);
    color: #6EE7B7;
  }

  /* AI Insight Card */
  .insight-card {
    background: linear-gradient(135deg, var(--surface-card), var(--surface-tint));
  }

  .insight-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
  }

  .insight-body {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
  }

  .stars-amber {
    color: #F59E0B;
    font-size: 13px;
    letter-spacing: 1px;
  }

  .insight-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563EB, #4F46E5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
  }

  /* Tables */
  .table-pena {
    color: var(--text-primary);
    font-size: 13px;
  }

  .table-pena thead th {
    background-color: var(--table-head-bg);
    color: var(--table-head-text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 11px 12px;
    border: none;
    white-space: nowrap;
  }

  .table-pena thead th:first-child {
    border-top-left-radius: 8px;
  }

  .table-pena thead th:last-child {
    border-top-right-radius: 8px;
  }

  .table-pena tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background-color: transparent;
    color: var(--text-primary);
  }

  .table-pena tbody tr:hover td {
    background-color: var(--table-hover);
  }

  /* Tabel Ringkasan Performa Kelas bebas scroll horizontal di layar desktop 100% */
  .table-overview-compact thead th {
    padding: 10px 7px;
    font-size: 10.5px;
  }

  .table-overview-compact tbody td {
    padding: 10px 7px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .col-highlight-head {
    background-color: #1D4ED8 !important;
  }

  .col-highlight-cell {
    background-color: var(--surface-tint) !important;
    font-weight: 700;
    color: var(--primary);
  }

  /* Pills & Badges */
  .filter-chip {
    min-height: 32px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .filter-chip:hover {
    background: var(--surface-subtle);
  }

  .filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
  }

  .badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
  }

  .badge-success {
    background: #DCFCE7;
    color: #166534;
  }

  .badge-danger {
    background: #FEE2E2;
    color: #991B1B;
  }

  .badge-warning {
    background: #FEF9C3;
    color: #854D0E;
  }

  .badge-muted {
    background: #F1F5F9;
    color: #475569;
  }

  [data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
  }

  [data-theme="dark"] .badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
  }

  [data-theme="dark"] .badge-muted {
    background: #1E293B;
    color: #94A3B8;
  }

  .pill-soft-gray {
    background: var(--surface-subtle);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
  }

  .table-leger th,
  .table-leger td {
    white-space: nowrap;
  }

  .pill-info-blue {
    background: #DBEAFE;
    color: #1D4ED8;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
  }

  .trend-up-pill {
    background: #ECFDF5;
    color: #059669;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
  }

  .badge-target-emerald {
    background: #ECFDF5;
    color: #059669;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
  }

  /* Forms & Buttons */
  .btn-primary-pena {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--radius-control);
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, transform 0.15s ease;
  }

  .btn-primary-pena:hover {
    background: var(--primary-hover);
    color: #FFFFFF;
  }

  .btn-primary-pena:active {
    transform: scale(0.98);
  }

  .btn-outline-pena {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: var(--radius-control);
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
  }

  .btn-outline-pena:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
  }

  /* Tombol Aksi Berwarna Lembut (Ekskul & Toolbar) */
  .btn-soft-pena {
    min-height: 38px;
    padding: 7px 14px;
    border-radius: var(--radius-control);
    font-weight: 600;
    font-size: 12.75px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  }

  .btn-soft-pena:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .ekskul-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
  }

  .ekskul-select-col {
    flex: 1 1 200px;
    min-width: 180px;
  }

  .ekskul-kelas-col {
    flex: 0 1 140px;
    min-width: 120px;
  }

  .ekskul-actions-col {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .ekskul-actions-col .btn-soft-pena,
  .ekskul-actions-col .btn-ekskul-enroll {
    height: 40px;
    min-height: 40px;
    padding: 6px 11px;
    font-size: 12.25px;
    white-space: nowrap;
  }

  @media (min-width: 992px) {
    .ekskul-actions-col {
      flex-wrap: nowrap;
    }
  }

  @media (min-width: 1120px) {
    .ekskul-controls-row {
      flex-wrap: nowrap;
    }
  }

  /* Halaman Panduan Pengguna */
  .guide-hero-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.06));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 20px 22px;
  }

  [data-theme="dark"] .guide-hero-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(16, 185, 129, 0.10));
  }

  .guide-step-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  }

  .guide-step-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: rgba(37, 99, 235, 0.35);
  }

  .guide-step-num {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .guide-flow-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
  }

  .guide-flow-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .guide-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
  }

  .guide-faq-item {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--canvas-bg);
    padding: 12px 15px;
  }

  .guide-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .guide-faq-item summary::-webkit-details-marker {
    display: none;
  }

  .guide-faq-item summary::after {
    content: '+';
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
  }

  .guide-faq-item[open] summary::after {
    content: '−';
  }

  .guide-faq-answer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
  }

  /* Interactive Guided Tour Overlay */
  .app-tour-layer {
    position: fixed;
    inset: 0;
    z-index: 1090;
    pointer-events: none;
  }

  .app-tour-backdrop-guard {
    position: fixed;
    inset: 0;
    pointer-events: auto;
    background: transparent;
  }

  .app-tour-spotlight {
    position: fixed;
    border-radius: 14px;
    border: 2px solid #3B82F6;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.56), 0 0 0 5px rgba(59, 130, 246, 0.28);
    transition: top 0.24s ease, left 0.24s ease, width 0.24s ease, height 0.24s ease;
    pointer-events: none;
    z-index: 1091;
  }

  .app-tour-popover {
    position: fixed;
    z-index: 1092;
    width: min(410px, calc(100vw - 24px));
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
    pointer-events: auto;
    transition: top 0.22s ease, left 0.22s ease, opacity 0.18s ease;
  }

  .tour-progress-track {
    height: 5px;
    width: 100%;
    border-radius: 9999px;
    background: var(--surface-subtle);
    overflow: hidden;
    margin: 10px 0 12px;
  }

  .tour-progress-fill {
    height: 100%;
    width: 10%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #2563EB, #10B981);
    transition: width 0.24s ease;
  }

  .tour-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
  }

  .tour-close-btn:hover {
    color: var(--text-primary);
    background: var(--border-subtle);
  }

  .btn-soft-pena:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .btn-soft-emerald {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #047857;
  }

  .btn-soft-emerald:hover:not(:disabled) {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #065F46;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.14);
  }

  .btn-soft-amber {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #B45309;
  }

  .btn-soft-amber:hover:not(:disabled) {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: #92400E;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.14);
  }

  .btn-soft-rose {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
  }

  .btn-soft-rose:hover:not(:disabled) {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #991B1B;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.14);
  }

  [data-theme="dark"] .btn-soft-emerald {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.36);
    color: #6EE7B7;
  }

  [data-theme="dark"] .btn-soft-emerald:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.24);
    border-color: rgba(110, 231, 183, 0.5);
    color: #A7F3D0;
  }

  [data-theme="dark"] .btn-soft-amber {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.36);
    color: #FCD34D;
  }

  [data-theme="dark"] .btn-soft-amber:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.24);
    border-color: rgba(252, 211, 77, 0.5);
    color: #FDE68A;
  }

  [data-theme="dark"] .btn-soft-rose {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.36);
    color: #FCA5A5;
  }

  [data-theme="dark"] .btn-soft-rose:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.24);
    border-color: rgba(252, 165, 165, 0.5);
    color: #FECACA;
  }

  .form-label-sm {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
  }

  .input-pena {
    min-height: 40px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border-input);
    background-color: var(--surface-card);
    color: var(--text-primary);
    font-size: 13.5px;
  }

  .input-pena:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: var(--surface-card);
    color: var(--text-primary);
  }

  .score-input-cell {
    width: 96px;
    min-height: 38px;
    margin: 0 auto;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .score-input-cell.below-kkm {
    border-color: #EF4444;
    color: #DC2626;
    background: rgba(239, 68, 68, 0.06);
  }

  .katrol-edit-cell {
    width: 96px;
    min-height: 38px;
    margin: 0 auto;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-color: rgba(37, 99, 235, 0.35);
    background-color: var(--surface-tint);
    color: var(--primary);
  }

  .katrol-edit-cell.locked {
    border-color: #F59E0B;
    background-color: rgba(245, 158, 11, 0.12);
    color: #B45309;
  }

  [data-theme="dark"] .katrol-edit-cell.locked {
    color: #FCD34D;
  }

  .btn-lock-toggle {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--border-input);
    background: var(--surface-card);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-lock-toggle:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
  }

  .btn-lock-toggle.locked {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #B45309;
  }

  [data-theme="dark"] .btn-lock-toggle.locked {
    background: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
  }

  .catatan-guru-input {
    min-height: 38px;
    min-width: 145px;
    font-size: 12.5px;
  }

  /* Segmented Control (Harian | PTS | PAS) */
  .segmented-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--surface-subtle);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
  }

  .seg-btn {
    min-height: 34px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .seg-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  }

  /* Bottom Action Bar (Statis di bawah tabel tanpa melayang menutupi konten) */
  .sticky-save-bar {
    position: static;
    margin-top: 16px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: var(--shadow-card);
  }

  .dot-amber {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F59E0B;
  }

  /* Bar Pemilih Ulangan Harian UH 1 - UH 8 */
  .uh-selector-bar,
  .input-kd-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-subtle);
  }

  .input-kd-bar {
    display: block;
  }

  .uh-bar-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
  }

  .uh-pills-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .uh-pill {
    min-height: 34px;
    padding: 4px 12px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: var(--canvas-bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .uh-pill:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
  }

  .uh-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  }

  .uh-pill-count {
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.18);
    color: #065F46;
    font-weight: 700;
  }

  .uh-pill.active .uh-pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
  }

  [data-theme="dark"] .uh-pill:not(.active) .uh-pill-count {
    color: #6EE7B7;
  }

  /* Mapel & Katrol Tabs */
  .pena-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--surface-subtle);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
  }

  .pena-tab-btn {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.16s ease;
  }

  .pena-tab-btn:hover {
    color: var(--text-primary);
  }

  .pena-tab-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  }

  /* Mapel & Katrol Editor */
  .mapel-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.15s ease;
  }

  .mapel-list-item:hover {
    background: var(--surface-subtle);
  }

  .mapel-list-item.active {
    background: var(--surface-tint);
    border-color: var(--primary);
    border-left: 4px solid var(--primary);
  }

  .subpanel-box {
    background: var(--canvas-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px;
  }

  .katrol-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    cursor: pointer;
    height: 100%;
  }

  .katrol-radio-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--surface-tint);
  }

  .simulation-preview-box {
    background: var(--surface-tint);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--text-primary);
  }

  /* Kelas Cards */
  .kelas-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .kelas-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }

  .progress-pena {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-subtle);
    overflow: hidden;
  }

  .progress-pena-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10B981, #059669);
  }

  /* Settings & Storage */
  .storage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Modals & Preview Stage */
  .modal-pena {
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
  }

  .bg-preview-stage {
    background: #E2E8F0;
    max-height: 72vh;
    overflow-y: auto;
  }

  [data-theme="dark"] .bg-preview-stage {
    background: #0F172A;
  }

  .preview-a4-sheet {
    background: #FFFFFF;
    color: #0F172A;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    transition: max-width 0.2s ease;
  }

  .preview-a4-sheet.preview-sheet-landscape {
    max-width: 1040px;
  }

  .preview-a4-sheet.preview-sheet-portrait {
    max-width: 590px;
  }

  /* Editorial Split-Screen Login Gate (Full-Bleed Viewport, Scroll-Free) */
  .pin-gate-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #0B1324;
    z-index: 9990;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
    overflow: hidden;
    scrollbar-width: none;
  }

  .pin-gate-overlay::-webkit-scrollbar {
    display: none;
  }

  .login-shell {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: var(--surface-card);
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    overflow: hidden;
    margin: 0;
  }

  .login-hero-pane {
    position: relative;
    height: 100%;
    background: #0B1324;
    color: #F8FAFC;
    padding: clamp(24px, 4.2vh, 44px) clamp(28px, 4.5vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(16px, 2.5vh, 26px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }

  .login-hero-main {
    max-width: 560px;
  }

  .login-hero-pane::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(to right, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.15));
    pointer-events: none;
  }

  .login-hero-top,
  .login-hero-main,
  .login-hero-footer {
    position: relative;
    z-index: 1;
  }

  .login-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .login-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .pin-gate-icon {
    width: 44px;
    height: 44px;
    margin: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  .pin-gate-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .login-brand-name {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .login-school-chip {
    font-size: 11.5px;
    font-weight: 600;
    color: #CBD5E1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 5px 11px;
    border-radius: 9999px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #93C5FD;
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 5px 12px;
    border-radius: 9999px;
    margin-bottom: 14px;
  }

  .login-hero-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(24px, 2.7vw, 38px);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -0.025em;
    color: #F8FAFC;
    margin: 0 0 14px;
  }

  .login-hero-desc {
    font-size: 14.5px;
    line-height: 1.58;
    color: #94A3B8;
    max-width: 50ch;
    margin: 0 0 22px;
  }

  .login-highlights {
    display: grid;
    gap: 10px;
    max-width: 480px;
  }

  .login-highlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    font-size: 13px;
    font-weight: 500;
  }

  .login-highlight-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.14);
    color: #34D399;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .login-hero-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 12px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .login-auth-pane {
    position: relative;
    height: 100%;
    background: var(--surface-card);
    padding: clamp(20px, 3.5vh, 36px) clamp(24px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    overflow: hidden;
  }

  /* Initial Boot Splash & Login Loading Feedback */
  .app-boot-splash {
    position: fixed;
    inset: 0;
    z-index: 9985;
    background: #0B1324;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.24s ease, visibility 0.24s ease;
  }

  .app-boot-splash.is-fading {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .boot-splash-card {
    width: 100%;
    max-width: 360px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    padding: 28px 26px;
    text-align: center;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.45);
  }

  .boot-splash-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
    animation: bootPulse 1.8s ease-in-out infinite;
  }

  .boot-splash-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #F8FAFC;
    margin-bottom: 4px;
  }

  .boot-splash-sub {
    font-size: 12.5px;
    color: #94A3B8;
    margin-bottom: 16px;
  }

  .boot-progress-track {
    width: 100%;
    height: 4px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
  }

  .boot-progress-fill,
  .login-progress-fill {
    width: 42%;
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #2563EB, #38BDF8, #10B981);
    animation: progressSweep 1.25s ease-in-out infinite;
  }

  .login-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(37, 99, 235, 0.12);
    overflow: hidden;
    z-index: 2;
  }

  .login-btn-spinner {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2.2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    animation: penaSpin 0.72s linear infinite;
    flex-shrink: 0;
  }

  .login-loading-hint {
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
  }

  [data-theme="dark"] .login-loading-hint {
    color: #93C5FD;
  }

  @keyframes penaSpin {
    to {
      transform: rotate(360deg);
    }
  }

  @keyframes progressSweep {
    0% {
      transform: translateX(-110%);
    }

    100% {
      transform: translateX(260%);
    }
  }

  @keyframes bootPulse {
    0%,
    100% {
      transform: scale(1);
    }

    50% {
      transform: scale(1.04);
    }
  }

  .login-auth-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 36px;
  }

  .login-auth-box {
    width: 100%;
    max-width: 390px;
    margin: auto;
  }

  .login-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    background: var(--surface-tint);
    padding: 4px 11px;
    border-radius: 9999px;
    margin-bottom: 10px;
  }

  .pin-gate-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 6px;
  }

  .pin-gate-subtitle {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 18px;
  }

  .login-pin-wrap {
    position: relative;
    display: flex;
    align-items: center;
  }

  .login-pin-input {
    min-height: 46px;
    padding-left: 42px;
    padding-right: 48px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    letter-spacing: normal;
    font-weight: 500;
    border-radius: 10px;
    border: 1.5px solid var(--border-input);
    background: var(--canvas-bg);
    color: var(--text-primary);
  }

  .login-pin-input::placeholder {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    color: #94A3B8;
    opacity: 1;
  }

  .login-username-input {
    padding-right: 14px;
  }

  [data-theme="dark"] .login-hero-pane {
    background: #070C17;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
  }

  [data-theme="dark"] .login-auth-pane {
    background: #0F172A;
  }

  [data-theme="dark"] .login-auth-topbar .btn-topbar-theme {
    background: #1E293B;
    border-color: rgba(148, 163, 184, 0.28);
    color: #E2E8F0;
  }

  [data-theme="dark"] .login-auth-badge {
    color: #93C5FD;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.28);
  }

  [data-theme="dark"] .pin-gate-title {
    color: #F8FAFC;
  }

  [data-theme="dark"] .pin-gate-subtitle {
    color: #CBD5E1;
  }

  [data-theme="dark"] .login-auth-box .form-label-sm {
    color: #E2E8F0;
  }

  [data-theme="dark"] .login-pin-input {
    background: #1E293B;
    border-color: rgba(148, 163, 184, 0.34);
    color: #F8FAFC;
  }

  [data-theme="dark"] .login-pin-input::placeholder {
    color: #94A3B8;
    opacity: 1;
  }

  [data-theme="dark"] .login-pin-input:focus {
    background: #1E293B;
    border-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.24);
  }

  [data-theme="dark"] .login-pin-lock-icon,
  [data-theme="dark"] .login-pin-eye-btn {
    color: #CBD5E1;
  }

  [data-theme="dark"] .login-pin-eye-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
  }

  [data-theme="dark"] .login-default-hint {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(148, 163, 184, 0.34);
    color: #E2E8F0;
  }

  [data-theme="dark"] .login-default-hint-title {
    color: #CBD5E1;
  }

  [data-theme="dark"] .login-default-hint-body code {
    background: #0F172A;
    border-color: rgba(96, 165, 250, 0.38);
    color: #93C5FD;
  }

  [data-theme="dark"] .btn-fill-default-login {
    background: rgba(37, 99, 235, 0.24);
    border-color: rgba(96, 165, 250, 0.45);
    color: #BFDBFE;
  }

  [data-theme="dark"] .btn-fill-default-login:hover {
    background: rgba(37, 99, 235, 0.40);
    border-color: #93C5FD;
    color: #FFFFFF;
  }

  [data-theme="dark"] .login-auth-foot {
    color: #94A3B8;
    border-top-color: rgba(148, 163, 184, 0.16);
  }

  .login-default-hint {
    background: var(--surface-subtle);
    border: 1px dashed var(--border-input);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
    color: var(--text-secondary);
  }

  .login-default-hint-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .login-default-hint-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .login-default-hint-body code {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    padding: 1px 6px;
    border-radius: 5px;
    font-weight: 700;
    color: var(--primary);
  }

  .btn-fill-default-login {
    margin-left: auto;
    border: 1px solid var(--border-input);
    background: var(--surface-card);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }

  .btn-fill-default-login:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
  }

  .login-pin-input:focus {
    background: var(--surface-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  }

  .login-pin-lock-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    display: inline-flex;
  }

  .login-pin-eye-btn {
    position: absolute;
    right: 4px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
  }

  .login-pin-eye-btn:hover {
    color: var(--text-primary);
    background: var(--surface-subtle);
  }

  .login-submit-btn {
    min-height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .login-submit-btn:active {
    transform: translateY(1px);
  }

  .login-auth-foot {
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }

  .inline-error {
    font-size: 12.5px;
    color: #EF4444;
    font-weight: 600;
  }

  /* Live Mini Preview di Tab Pengaturan Tampilan Login */
  .login-mini-preview {
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 220px;
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
  }

  .login-mini-hero {
    background: #0B1324;
    color: #F8FAFC;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    border-left: 3px solid #2563EB;
  }

  .login-mini-auth {
    background: var(--surface-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  @media (max-height: 460px) and (min-width: 992px) {
    .login-highlights {
      display: none;
    }

    .login-hero-desc {
      margin-bottom: 0;
    }

    .login-hero-pane,
    .login-auth-pane {
      padding: 18px 30px;
      gap: 10px;
    }
  }

  @media (max-width: 991.98px) {
    .pin-gate-overlay {
      padding: 0;
      align-items: stretch;
      overflow: hidden;
    }

    .login-shell {
      width: 100%;
      height: 100%;
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
      border-radius: 0;
    }

    .login-hero-pane {
      height: auto;
      padding: 16px 20px;
      border-right: none;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      gap: 8px;
    }

    .login-eyebrow,
    .login-highlights,
    .login-hero-footer {
      display: none;
    }

    .login-hero-title {
      font-size: 19px;
      margin-bottom: 4px;
    }

    .login-hero-desc {
      font-size: 12.5px;
      margin-bottom: 0;
    }

    .login-auth-pane {
      height: auto;
      padding: 18px 20px 20px;
      gap: 10px;
    }

    .login-auth-topbar,
    .login-auth-foot {
      display: none;
    }
  }

  @media (max-width: 991.98px) and (max-height: 620px) {
    .login-hero-desc {
      display: none;
    }
  }

  @media (max-width: 575.98px) {
    .login-mini-preview {
      grid-template-columns: 1fr;
    }
  }

  /* Toast Notifications (Soft Modern Glass Pill) */
  .toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9995;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 370px;
  }

  .toast-item {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    padding: 11px 14px;
    box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.16);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: toastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }

  [data-theme="dark"] .toast-item {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.5);
  }

  .toast-icon-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.12);
    color: #2563EB;
  }

  .toast-item.toast-success .toast-icon-badge {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
  }

  .toast-item.toast-error .toast-icon-badge {
    background: rgba(239, 68, 68, 0.14);
    color: #DC2626;
  }

  .toast-item.toast-warning .toast-icon-badge {
    background: rgba(245, 158, 11, 0.16);
    color: #D97706;
  }

  [data-theme="dark"] .toast-item.toast-info .toast-icon-badge {
    color: #93C5FD;
  }

  [data-theme="dark"] .toast-item.toast-success .toast-icon-badge {
    color: #6EE7B7;
  }

  [data-theme="dark"] .toast-item.toast-error .toast-icon-badge {
    color: #FCA5A5;
  }

  [data-theme="dark"] .toast-item.toast-warning .toast-icon-badge {
    color: #FCD34D;
  }

  /* Modal Konfirmasi Logout Elegan & Lembut */
  .modal-logout-soft {
    border-radius: 20px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.24);
  }

  .logout-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.20);
    color: #EF4444;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  [data-theme="dark"] .logout-icon-badge {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.30);
    color: #FCA5A5;
  }

  .logout-unsaved-alert {
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #B45309;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
  }

  [data-theme="dark"] .logout-unsaved-alert {
    color: #FCD34D;
    background: rgba(245, 158, 11, 0.16);
  }

  .btn-soft-cancel {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 600;
    transition: background-color 0.15s ease;
  }

  .btn-soft-cancel:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
  }

  .btn-soft-danger {
    min-height: 42px;
    border-radius: 10px;
    border: none;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 6px 14px -4px rgba(239, 68, 68, 0.45);
    transition: background-color 0.15s ease, transform 0.15s ease;
  }

  .btn-soft-danger:hover {
    background: #DC2626;
    color: #FFFFFF;
    transform: translateY(-1px);
  }

  @keyframes toastIn {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Skeleton Shimmer */
  .skeleton-box {
    border-radius: var(--radius-card);
    background: linear-gradient(90deg, var(--surface-subtle) 25%, var(--border-subtle) 50%, var(--surface-subtle) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
  }

  @keyframes shimmer {
    0% {
      background-position: 200% 0;
    }

    100% {
      background-position: -200% 0;
    }
  }

  /* Footer */
  .app-footer {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
  }

  .dot-emerald-inline {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    margin-right: 4px;
  }

  /* Mobile Topbar & Bottom Nav */
  .mobile-topbar {
    background: var(--sidebar-bg);
    color: #FFFFFF;
    padding: 10px 14px;
    margin: -20px -28px 16px -28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .btn-mobile-menu {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }

  .sync-pill-sm {
    font-size: 10px;
    padding: 2px 8px;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-card);
    border-top: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1030;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }

  .bottom-nav-btn {
    min-height: 54px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10.5px;
    font-weight: 600;
  }

  .bottom-nav-btn.active {
    color: var(--primary);
  }

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

  /* Responsive Breakpoints */
  @media (max-width: 1279px) {
    .kpi-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (max-width: 991.98px) {
    .app-sidebar {
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      height: 100vh;
      transform: translateX(-100%);
    }

    .sidebar-sticky-inner {
      position: static;
      min-height: 100%;
      max-height: 100%;
    }

    .app-sidebar.open {
      transform: translateX(0);
    }

    .app-main {
      padding: 16px 46px calc(76px + env(safe-area-inset-bottom)) 16px;
    }

    .mobile-topbar {
      margin: -16px -46px 14px -16px;
    }

    .quick-scroll-dock {
      right: 8px;
      bottom: calc(68px + env(safe-area-inset-bottom));
    }
  }

  @media (max-width: 767.98px) {
    .kpi-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .kpi-card:last-child {
      grid-column: span 2;
    }

    .donut-grid,
    .donut-grid.donut-grid-compact {
      grid-template-columns: 1fr;
      text-align: left;
    }

    .topbar-heading {
      font-size: 20px;
    }
  }

  /* Keterangan Predikat Ringkas (A-E) */
  .pred-legend-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
  }

  .pred-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .pred-letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
  }

  .pred-badge-a {
    background: #F3E8FF;
    color: #6D28D9;
  }

  .pred-badge-b {
    background: #D1FAE5;
    color: #047857;
  }

  .pred-badge-c {
    background: #DBEAFE;
    color: #1D4ED8;
  }

  .pred-badge-d {
    background: #FEF3C7;
    color: #B45309;
  }

  .pred-badge-e {
    background: #FEE2E2;
    color: #B91C1C;
  }

  html[data-theme="dark"] .pred-badge-a {
    background: rgba(124, 58, 237, 0.22);
    color: #C4B5FD;
  }

  html[data-theme="dark"] .pred-badge-b {
    background: rgba(16, 185, 129, 0.22);
    color: #6EE7B7;
  }

  html[data-theme="dark"] .pred-badge-c {
    background: rgba(37, 99, 235, 0.24);
    color: #93C5FD;
  }

  html[data-theme="dark"] .pred-badge-d {
    background: rgba(245, 158, 11, 0.22);
    color: #FCD34D;
  }

  html[data-theme="dark"] .pred-badge-e {
    background: rgba(239, 68, 68, 0.22);
    color: #FCA5A5;
  }

  /* Pengaturan Logo (Upload + URL) */
  .logo-upload-card {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
  }

  .logo-preview-box {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: var(--text-muted);
  }

  .logo-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 4px;
  }

  /* Floating Quick-Scroll Dock (Terletak di gutter tepi kanan, tidak menutupi area kerja) */
  .quick-scroll-dock {
    position: fixed;
    right: 11px;
    bottom: 22px;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  [data-theme="dark"] .quick-scroll-dock {
    background: rgba(15, 23, 42, 0.90);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  }

  .quick-scroll-dock.is-hidden,
  body.login-gate-open .quick-scroll-dock,
  body.modal-open .quick-scroll-dock {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
  }

  .quick-scroll-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  }

  .quick-scroll-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #FFFFFF;
  }

  .quick-scroll-btn:disabled {
    opacity: 0.28;
    cursor: default;
  }

  .quick-scroll-divider {
    width: 16px;
    height: 1px;
    background: var(--border-subtle);
  }

  /* Non-Akademik: Ekstrakurikuler Chips & Checklist */
  .ekskul-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .ekskul-chip {
    min-height: 36px;
    padding: 5px 12px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: var(--canvas-bg);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .ekskul-chip:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
  }

  .ekskul-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  }

  .ekskul-chip-count {
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.2);
  }

  .ekskul-chip.active .ekskul-chip-count {
    background: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
  }

  .enroll-checklist-box {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--canvas-bg);
    padding: 6px;
    display: grid;
    gap: 4px;
  }

  .enroll-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    font-size: 13px;
  }

  .enroll-row-item:hover {
    background: var(--surface-subtle);
  }

  .enroll-row-item.is-enrolled {
    opacity: 0.72;
    cursor: default;
  }

  /* Credit / Signature Watermark Aplikasi (Hanya tampil di UI, tidak tercetak di Rapor) */
  .app-wm-credit {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    font-weight: 400;
    letter-spacing: 0.02em;
  }

  .app-wm-login {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    background: transparent;
    border: none;
    color: rgba(148, 163, 184, 0.62);
    font-size: 10px;
    font-weight: 400;
    opacity: 0.72;
    white-space: nowrap;
  }

  .app-wm-login .app-wm-name {
    color: rgba(203, 213, 225, 0.78);
    font-weight: 400;
  }

  .app-wm-login .app-wm-icon {
    color: rgba(148, 163, 184, 0.62);
    flex-shrink: 0;
  }

  .app-wm-sidebar {
    margin-top: 10px;
    padding: 2px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(148, 163, 184, 0.64);
    text-align: center;
  }

  .app-wm-sidebar .app-wm-name {
    color: rgba(203, 213, 225, 0.80);
    font-weight: 500;
  }

  .app-wm-sidebar .app-wm-icon {
    color: rgba(96, 165, 250, 0.70);
    flex-shrink: 0;
  }

  .app-wm-footer {
    flex: 1 0 100%;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.76;
    text-align: center;
  }

  .app-wm-footer .app-wm-name {
    color: var(--text-secondary);
    font-weight: 500;
  }

  .app-wm-footer .app-wm-icon {
    color: var(--primary);
    opacity: 0.78;
    flex-shrink: 0;
  }

  @media print {
    .app-wm-credit,
    [data-app-credit] {
      display: none !important;
      visibility: hidden !important;
    }
  }

  @media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
