    :root {
      --ref-orange: #FF3D19;
      --ref-orange-2: #E8330F;
      --ref-orange-soft: #FFF0EC;
      --ref-navy: #1C3259;
      --ref-navy-2: #2E4A7D;
      --ref-navy-3: #8FA0BF;
      --ref-navy-soft: #EEF1F7;
      --ref-bg: #EEF0F5;
      --ref-card: #FFFFFF;
      --ref-line: #ECEEF4;
      --ref-text: #1C2434;
      --ref-muted: #6B7489;
      --ref-up: #18A957;
      --ref-up-bg: #DDF7E8;
      --ref-down-bg: #FFE3DD;
      --ref-radius: 22px;
      --ref-shadow: 0 1px 2px rgba(28, 50, 89, .04), 0 6px 20px rgba(28, 50, 89, .05);
    }

    /* ---------- Dasar (hanya area aplikasi; halaman login tidak diubah) ---------- */
    .app {
      background: var(--ref-bg);
    }

    [data-dark="1"] .app {
      background: transparent;
    }

    .app,
    .app button,
    .app input,
    .app select,
    .app textarea,
    #bluNotifPanel {
      font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    }

    /* ---------- Layout desktop: sidebar melayang (kartu) ---------- */
    @media screen and (min-width: 821px) {
      .app {
        padding: 20px;
        column-gap: 22px;
        --sidebar: 272px;
      }

      .app .sidebar {
        top: 20px;
        /* .app memakai zoom .75 (blu-compact-zoom) -> tinggi viewport = 100vh/.75 */
        /* sisakan ruang untuk ticker (#blu-ticker) yang fixed di bawah */
        height: calc(100vh / 0.75 - 84px);
        border-radius: 26px;
        box-shadow: var(--ref-shadow);
        display: flex;
        flex-direction: column;
      }

      .app .topbar {
        position: sticky;
        top: 0;
        margin: -20px 0 0;
        padding: 26px 6px 18px;
        background: var(--ref-bg);
        border-bottom: 0;
      }

      .app .content {
        padding: 6px 6px 40px;
      }

      /* Info user dipindah ke chip kanan atas seperti referensi */
      .app .sidebar .user-box {
        display: none;
      }
    }

    /* ---------- Sidebar ---------- */
    .app .sidebar {
      background: var(--ref-card);
      color: var(--ref-navy);
      padding: 24px 18px;
      scrollbar-width: thin;
      scrollbar-color: #d9deea transparent;
    }

    .app .sidebar .brand-title {
      color: var(--ref-navy);
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -.01em;
    }

    .app .sidebar .brand-sub {
      color: var(--ref-muted);
      opacity: 1;
    }

    .app .sidebar .brand-mark {
      margin-bottom: 22px;
      padding: 0 6px;
    }

    .app .sidebar .logo-cube {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      color: #fff;
    }

    .app .user-box {
      background: var(--ref-navy-soft);
      border: 0;
      border-radius: 16px;
      color: var(--ref-navy);
    }

    .app .user-box .role {
      color: var(--ref-muted);
    }

    .app .nav {
      gap: 4px;
      margin-top: 0;
    }

    .app .nav-group {
      gap: 4px;
    }

    .app .nav button {
      color: #5B6478;
      font-weight: 600;
      font-size: 14px;
      padding: 11px 14px;
      border-radius: 14px;
      border-left: 0 !important;
      transition: background .15s, color .15s, box-shadow .15s;
    }

    .app .nav button .icon {
      color: #8A93A8;
    }

    .app .nav button:hover {
      background: #F4F5F9;
      color: var(--ref-navy);
    }

    .app .nav button:hover .icon {
      color: var(--ref-navy);
    }

    .app .nav button.active {
      background: var(--ref-orange);
      color: #fff;
      box-shadow: 0 8px 18px rgba(255, 61, 25, .28);
    }

    .app .nav button.active .icon {
      color: #fff;
    }

    .app .nav-subitems {
      border-left: 2px solid var(--ref-line);
      gap: 2px;
    }

    .app .nav-subitems button {
      font-size: 13px;
      padding: 9px 12px;
    }

    .app .nav-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: #A0A7B8;
      padding: 14px 14px 6px;
    }

    .app .nav-label:first-child {
      padding-top: 2px;
    }

    /* Kartu promo bawah sidebar (padanan "Upgrade Pro" pada referensi) */
    .blu-side-promo {
      position: relative;
      overflow: hidden;
      margin-top: auto;
      flex-shrink: 0;
      background: var(--ref-navy);
      color: #fff;
      border-radius: 20px;
      padding: 18px 16px 16px;
      top: 0;
    }

    .app .nav+.blu-side-promo {
      margin-top: 22px;
    }

    @media screen and (min-width: 821px) {
      .app .nav+.blu-side-promo {
        margin-top: auto;
      }

      .app .nav {
        margin-bottom: 18px;
      }
    }

    .blu-side-promo::after {
      content: "";
      position: absolute;
      right: -38px;
      bottom: -46px;
      width: 150px;
      height: 150px;
      border-radius: 50%;
      border: 26px solid rgba(255, 255, 255, .06);
      pointer-events: none;
    }

    .blu-side-promo .promo-ico {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: #fff;
      color: var(--ref-orange);
      display: grid;
      place-items: center;
      font-size: 16px;
    }

    .blu-side-promo h4 {
      margin: 12px 0 4px;
      font-size: 16px;
      font-weight: 800;
    }

    .blu-side-promo p {
      margin: 0 0 14px;
      font-size: 12px;
      line-height: 1.5;
      color: rgba(255, 255, 255, .72);
    }

    .blu-side-promo .btn {
      width: 100%;
      position: relative;
      z-index: 1;
      background: var(--ref-orange);
      color: #fff;
      border-radius: 12px;
      min-height: 42px;
    }

    .blu-side-promo .btn:hover {
      background: var(--ref-orange-2);
    }

    /* ---------- Topbar ---------- */
    .app .topbar h1 {
      font-size: 28px;
      font-weight: 800;
      color: var(--ref-navy);
      letter-spacing: -.02em;
    }

    .app .topbar p {
      color: var(--ref-muted);
    }

    #bluTopDate {
      display: inline;
      font-weight: 600;
      color: var(--ref-muted);
    }

    #bluTopDate::after {
      content: "\00B7";
      margin: 0 8px;
      color: #B5BCCB;
    }

    .app .topbar #pageSub {
      display: inline;
    }

    .app .top-actions {
      gap: 10px;
    }

    /* Judul boleh membungkus, tombol aksi tetap satu baris (desktop) */
    @media screen and (min-width: 1100px) {
      .app .topbar>div:first-child {
        flex: 1;
        min-width: 0;
      }

      .app .top-actions {
        flex-wrap: nowrap;
        flex-shrink: 0;
      }
    }

    .app .top-actions .btn,
    .app .top-actions select,
    .app #blu-clock {
      border-radius: 999px;
      border: 1px solid var(--ref-line);
      background: var(--ref-card);
      box-shadow: 0 1px 2px rgba(28, 50, 89, .04);
      color: var(--ref-navy);
      min-height: 42px;
    }

    .app .top-actions .badge {
      border-radius: 999px;
      padding: 8px 14px;
    }

    .app #globalSearchInput {
      border-radius: 999px !important;
      border: 1px solid var(--ref-line) !important;
      background: var(--ref-card) !important;
      min-height: 42px;
      padding-left: 16px !important;
      box-shadow: 0 1px 2px rgba(28, 50, 89, .04);
    }

    .app #globalSearchInput:focus {
      outline: none;
      border-color: var(--ref-orange) !important;
      box-shadow: 0 0 0 3px rgba(255, 61, 25, .14);
    }

    .app #darkToggleBtn,
    .app #bluNotifBtn {
      width: 42px;
      height: 42px;
      min-height: 42px;
      padding: 0 !important;
      border-radius: 50% !important;
      border: 1px solid var(--ref-line) !important;
      background: var(--ref-card) !important;
      display: inline-grid !important;
      place-items: center;
      position: relative;
    }

    .app .top-actions #logout {
      background: var(--ref-orange-soft);
      color: var(--ref-orange-2);
      border-color: #FFD4CA;
    }

    .app .top-actions #logout:hover {
      background: #FFE3DB;
    }

    /* Chip user kanan atas (avatar + nama + role) */
    .blu-user-chip {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 4px 14px 4px 4px;
      border-radius: 999px;
      background: var(--ref-card);
      border: 1px solid var(--ref-line);
      box-shadow: 0 1px 2px rgba(28, 50, 89, .04);
      max-width: 240px;
    }

    .blu-user-chip .ava {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--ref-navy);
      color: #fff;
      display: grid;
      place-items: center;
      font-weight: 800;
      font-size: 13px;
      flex-shrink: 0;
    }

    .blu-user-chip .who {
      min-width: 0;
      line-height: 1.2;
    }

    .blu-user-chip b {
      display: block;
      font-size: 13.5px;
      color: var(--ref-navy);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .blu-user-chip small {
      display: block;
      font-size: 11.5px;
      color: var(--ref-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    @media (max-width: 820px) {
      .blu-user-chip {
        display: none;
      }
    }

    /* ---------- Kartu ---------- */
    .app .card {
      border: 1px solid var(--ref-line);
      border-radius: var(--ref-radius);
      box-shadow: var(--ref-shadow);
      padding: 22px;
    }

    .app .card h3 {
      color: var(--ref-navy);
      font-weight: 800;
      font-size: 18px;
    }

    .app .btn-primary {
      background: var(--ref-orange);
      box-shadow: 0 6px 14px rgba(255, 61, 25, .22);
    }

    .app .btn-primary:hover {
      background: var(--ref-orange-2);
    }

    .app .btn {
      border-radius: 12px;
    }

    .app .badge {
      border-radius: 999px;
    }

    /* ---------- KPI: ikon kiri-atas, badge kanan-atas, nilai besar ---------- */
    .app .kpi {
      border-top: 1px solid var(--ref-line);
      padding: 20px 22px 22px;
      display: flex;
      flex-direction: column;
    }

    .app .kpi .kpi-ico {
      width: 44px;
      height: 44px;
      border-radius: 14px;
      background: var(--ref-navy-soft);
      color: var(--ref-navy);
      display: grid;
      place-items: center;
      font-size: 17px;
      margin-bottom: 18px;
      flex-shrink: 0;
    }

    .app .kpi .label {
      order: 1;
      text-transform: none;
      letter-spacing: 0;
      font-size: 14px;
      font-weight: 600;
      color: var(--ref-text);
    }

    .app .kpi .value {
      order: 2;
      color: var(--ref-navy);
      font-size: clamp(18px, 1.8vw, 26px);
      font-weight: 800;
      margin-top: 6px;
      word-break: normal;
      overflow-wrap: break-word;
    }

    .app .kpi .note {
      order: 3;
      margin-top: 6px;
    }

    .app .kpi .badge {
      position: absolute;
      top: 22px;
      right: 22px;
      margin: 0;
      padding: 4px 10px;
      font-size: 11.5px;
    }

    /* KPI pertama tiap halaman = kartu sorotan solid (seperti "Total Sales") */
    .app .kpi.kpi-hero {
      background: var(--ref-orange);
      border-color: var(--ref-orange);
      color: #fff;
      box-shadow: 0 14px 30px rgba(255, 61, 25, .26);
    }

    .app .kpi.kpi-hero::before {
      content: "";
      position: absolute;
      right: -60px;
      bottom: -80px;
      width: 220px;
      height: 220px;
      border-radius: 50%;
      border: 36px solid rgba(255, 255, 255, .08);
      pointer-events: none;
    }

    .app .kpi.kpi-hero .kpi-ico {
      background: #fff;
      color: var(--ref-orange);
    }

    .app .kpi.kpi-hero .label,
    .app .kpi.kpi-hero .value {
      color: #fff;
    }

    .app .kpi.kpi-hero .note {
      color: rgba(255, 255, 255, .85);
    }

    .app .kpi.kpi-hero .badge {
      background: #fff;
      color: var(--ref-orange-2);
    }

    /* ---------- Widget dashboard bergaya referensi ---------- */
    .blu-ref-row {
      display: grid;
      grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1fr);
      gap: 18px;
    }

    @media (max-width: 1280px) {
      .blu-ref-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      }

      .blu-ref-row .ref-habits {
        grid-column: 1 / -1;
      }
    }

    @media (max-width: 820px) {
      .blu-ref-row {
        grid-template-columns: minmax(0, 1fr);
      }
    }

    .blu-ref-row .card {
      display: flex;
      flex-direction: column;
    }

    .ref-select {
      border: 1px solid var(--ref-line);
      background: var(--ref-card);
      color: var(--ref-navy);
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 12.5px;
      font-weight: 600;
      min-height: 36px;
      cursor: pointer;
    }

    .ref-legend {
      display: flex;
      gap: 18px;
      font-size: 12.5px;
      color: var(--ref-muted);
      margin: 2px 0 12px;
    }

    .ref-legend i {
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      margin-right: 7px;
      vertical-align: -1px;
    }

    /* Bar chart berpasangan */
    .ref-bars {
      position: relative;
      display: grid;
      grid-template-columns: 44px 1fr;
      gap: 6px;
      flex: 1;
      min-height: 230px;
    }

    .ref-yaxis,
    .ref-grid {
      display: flex;
      flex-direction: column-reverse;
      justify-content: space-between;
    }

    .ref-yaxis {
      font-size: 11px;
      color: #A0A7B8;
      padding: 8px 0 24px;
    }

    /* label sumbu-Y tepat di garis grid */
    .ref-yaxis span {
      height: 0;
      display: flex;
      align-items: center;
    }

    .ref-grid {
      position: absolute;
      inset: 8px 0 24px;
      pointer-events: none;
    }

    .ref-grid i {
      height: 1px;
      background: var(--ref-line);
    }

    .ref-plot {
      position: relative;
      display: flex;
      align-items: stretch;
      justify-content: space-around;
      gap: 6px;
      padding: 8px 0 24px;
    }

    .ref-col {
      position: relative;
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      min-width: 0;
      cursor: default;
      border-radius: 12px;
      outline: none;
    }

    .ref-col .pair {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: flex-end;
      gap: 5px;
      height: 100%;
    }

    .ref-col .b {
      width: clamp(10px, 1.4vw, 20px);
      border-radius: 8px;
      min-height: 4px;
      transition: filter .15s;
    }

    .ref-col .b.a {
      background: #D7DCE8;
    }

    .ref-col .b.w {
      background: var(--ref-orange);
    }

    .ref-col .m {
      position: absolute;
      bottom: -22px;
      font-size: 11.5px;
      color: var(--ref-muted);
      white-space: nowrap;
    }

    .ref-col .tip {
      position: absolute;
      bottom: calc(100% - 6px);
      left: 50%;
      transform: translate(-50%, 4px);
      background: var(--ref-navy);
      color: #fff;
      border-radius: 12px;
      padding: 9px 12px;
      font-size: 12px;
      line-height: 1.6;
      white-space: nowrap;
      pointer-events: none;
      opacity: 0;
      transition: opacity .15s, transform .15s;
      z-index: 3;
      box-shadow: 0 10px 24px rgba(28, 50, 89, .25);
    }

    .ref-col .tip i {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 6px;
    }

    .ref-col:hover .tip,
    .ref-col:focus-visible .tip {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    .ref-col:hover .b,
    .ref-col:focus-visible .b {
      filter: brightness(.94);
    }

    .ref-col:focus-visible {
      box-shadow: 0 0 0 2px rgba(255, 61, 25, .35);
    }

    /* Radial (cincin bertingkat) */
    .ref-radial {
      position: relative;
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: center;
      gap: 6px;
      margin: 4px 0 14px;
    }

    .ref-radial svg {
      width: 190px;
      height: 190px;
    }

    .ref-radial .center b {
      display: block;
      font-size: 28px;
      font-weight: 800;
      color: var(--ref-navy);
      letter-spacing: -.02em;
    }

    .ref-radial .center span {
      display: block;
      font-size: 12.5px;
      color: var(--ref-muted);
      margin: 2px 0 8px;
    }

    .ref-pill,
    .ref-radial .center .ref-pill {
      display: inline-block;
      border-radius: 999px;
      padding: 3px 9px;
      font-size: 11.5px;
      font-weight: 700;
      background: var(--ref-up-bg);
      color: #0E7A3D;
    }

    .ref-pill.down {
      background: var(--ref-down-bg);
      color: #C2290C;
    }

    .ref-pill.neutral {
      background: var(--ref-navy-soft);
      color: var(--ref-navy);
    }

    .ref-list {
      display: grid;
      gap: 10px;
      margin-top: auto;
    }

    .ref-list .row {
      display: grid;
      grid-template-columns: 14px 1fr auto auto;
      align-items: center;
      gap: 10px;
      font-size: 13.5px;
    }

    .ref-list .row .dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }

    .ref-list .row span:not(.ref-pill) {
      color: var(--ref-text);
      font-weight: 600;
    }

    .ref-list .row b {
      color: var(--ref-navy);
      font-weight: 800;
    }

    /* Bubble (sebaran per sales) */
    .ref-growth {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      flex: 1;
    }

    .ref-bubbles {
      position: relative;
      width: 190px;
      height: 190px;
      max-width: 100%;
      justify-self: center;
    }

    .ref-bubbles .bub {
      position: absolute;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: #fff;
      font-weight: 800;
      font-size: 13px;
      box-shadow: 0 0 0 3px #fff;
    }

    .ref-growth-list {
      display: grid;
      gap: 12px;
    }

    .ref-growth-list .it {
      font-size: 12.5px;
    }

    .ref-growth-list .it .nm {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 700;
      color: var(--ref-text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .ref-growth-list .it .nm i {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .ref-growth-list .trk {
      height: 5px;
      border-radius: 999px;
      background: var(--ref-navy-soft);
      margin: 6px 0 0 18px;
      overflow: hidden;
    }

    .ref-growth-list .trk span {
      display: block;
      height: 100%;
      border-radius: inherit;
    }

    .ref-empty {
      flex: 1;
      display: grid;
      place-items: center;
      text-align: center;
      color: var(--ref-muted);
      font-size: 13px;
      min-height: 160px;
      padding: 10px;
    }

    /* ---------- Dark mode (mengikuti toggle bawaan [data-dark]) ---------- */
    [data-dark="1"] .app .topbar {
      background: var(--bg, #1a1a2e) !important;
    }

    [data-dark="1"] .app .sidebar {
      background: #16213e !important;
    }

    [data-dark="1"] .app .sidebar .brand-title,
    [data-dark="1"] .app .topbar h1,
    [data-dark="1"] .app .card h3,
    [data-dark="1"] .app .kpi .value,
    [data-dark="1"] .app .kpi .label,
    [data-dark="1"] .blu-user-chip b,
    [data-dark="1"] .ref-radial .center b,
    [data-dark="1"] .ref-list .row b,
    [data-dark="1"] .ref-list .row span:not(.ref-pill),
    [data-dark="1"] .ref-growth-list .it .nm {
      color: #E6EAF3;
    }

    [data-dark="1"] .app .nav button {
      color: #B4BDD0;
    }

    [data-dark="1"] .app .nav button:hover {
      background: rgba(255, 255, 255, .06);
      color: #fff;
    }

    [data-dark="1"] .app .nav button.active {
      background: var(--ref-orange);
      color: #fff;
    }

    [data-dark="1"] .app .kpi .kpi-ico,
    [data-dark="1"] .ref-pill.neutral {
      background: #0f3460;
      color: #E6EAF3;
    }

    [data-dark="1"] .app .kpi.kpi-hero {
      background: var(--ref-orange) !important;
      border-color: var(--ref-orange) !important;
    }

    [data-dark="1"] .app .kpi.kpi-hero .kpi-ico {
      background: #fff;
      color: var(--ref-orange);
    }

    [data-dark="1"] .app .kpi.kpi-hero .label,
    [data-dark="1"] .app .kpi.kpi-hero .value {
      color: #fff;
    }

    [data-dark="1"] .blu-user-chip,
    [data-dark="1"] .app .top-actions .btn,
    [data-dark="1"] .app .top-actions select,
    [data-dark="1"] .app #blu-clock,
    [data-dark="1"] .app #globalSearchInput,
    [data-dark="1"] .app #darkToggleBtn,
    [data-dark="1"] .app #bluNotifBtn,
    [data-dark="1"] .ref-select {
      background: #16213e !important;
      border-color: #0f3460 !important;
      color: #E6EAF3;
    }

    [data-dark="1"] .ref-col .b.a {
      background: #34507F;
    }

    [data-dark="1"] .ref-grid i {
      background: #22345a;
    }

    [data-dark="1"] .ref-bubbles .bub {
      box-shadow: 0 0 0 3px #16213e;
    }

    [data-dark="1"] .ref-growth-list .trk {
      background: #22345a;
    }

    [data-dark="1"] .app .nav-subitems {
      border-left-color: #22345a;
    }

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

      .ref-col .tip,
      .app .nav button {
        transition: none;
      }
    }
