:root {
      --bg-main: #fff6f9;
      --bg-card: #ffffff;
      --bg-soft: #fdf2f7;
      --bg-soft-2: #fce7f1;
      --border-soft: #f3d2e0;
      --text-main: #432434;
      --text-muted: #8c667a;
      --btn-pink: #e18aaa;
      --btn-pink-hover: #d17496;
      --btn-sage: #7bb8a0;
      --btn-sage-hover: #67a68d;
      --btn-lavender: #a293d6;
      --btn-lavender-hover: #8e7ec7;
      --btn-blue: #84aad8;
      --btn-blue-hover: #6f97c7;
      --btn-peach: #e5a87d;
      --btn-peach-hover: #d59568;
      --btn-coral: #df8296;
      --btn-coral-hover: #ce6e83;
      --btn-sky: #7db4d1;
    }
    body {
      font-family: 'Inter', sans-serif;
      background-color: var(--bg-main);
      background-image:
        radial-gradient(circle at 12% 14%, rgba(225, 138, 170, 0.16) 0%, transparent 38%),
        radial-gradient(circle at 88% 18%, rgba(246, 206, 222, 0.36) 0%, transparent 42%),
        radial-gradient(circle at 82% 88%, rgba(225, 138, 170, 0.16) 0%, transparent 40%);
      background-attachment: fixed;
      color: var(--text-main);
      transition: background-color 0.25s ease, color 0.25s ease;
    }

    /* Soft Pastel Surfaces & Borders (Light Mode) */
    .bg-slate-100 { background-color: #fff1f6 !important; }
    .bg-slate-50 { background-color: #fdf2f7 !important; }
    .border-slate-200 { border-color: #f3d2e0 !important; }
    .border-slate-300 { border-color: #ecc0d3 !important; }
    .divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: #fae6ef !important; }
    .hover\:bg-slate-50:hover { background-color: #fff5f9 !important; }
    .hover\:bg-slate-100:hover { background-color: #fbe6ef !important; }

    /* Soft Pastel Button & Accent Palette (Anchored on #e18aaa) */
    .bg-slate-900 {
      background: linear-gradient(135deg, #e18aaa 0%, #d87c9e 100%) !important;
      color: #ffffff !important;
    }
    .hover\:bg-slate-800:hover {
      background: linear-gradient(135deg, #d17496 0%, #c6678a 100%) !important;
    }
    .tab-btn.active {
      background: linear-gradient(135deg, #e18aaa 0%, #d87c9e 100%) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px -2px rgba(225, 138, 170, 0.42);
    }

    /* Soft Sage (WhatsApp, Deposit, Export) */
    .bg-emerald-600, .bg-emerald-700 {
      background-color: var(--btn-sage) !important;
      color: #ffffff !important;
    }
    .hover\:bg-emerald-700:hover {
      background-color: var(--btn-sage-hover) !important;
    }
    .border-emerald-600 { border-color: var(--btn-sage) !important; }

    /* Soft Lavender (QRIS) */
    .bg-indigo-600 {
      background-color: var(--btn-lavender) !important;
      color: #ffffff !important;
    }
    .hover\:bg-indigo-700:hover {
      background-color: var(--btn-lavender-hover) !important;
    }

    /* Soft Periwinkle Blue (Refund) */
    .bg-blue-600 {
      background-color: var(--btn-blue) !important;
      color: #ffffff !important;
    }
    .hover\:bg-blue-700:hover {
      background-color: var(--btn-blue-hover) !important;
    }
    .border-blue-600 { border-color: var(--btn-blue) !important; }

    /* Soft Warm Peach (Deadstock, Demo) */
    .bg-amber-500, .bg-amber-600 {
      background-color: var(--btn-peach) !important;
      color: #ffffff !important;
    }
    .hover\:bg-amber-600:hover, .hover\:bg-amber-700:hover {
      background-color: var(--btn-peach-hover) !important;
    }

    /* Soft Dusty Coral (Modal/Biaya, Update Password) */
    .bg-rose-600, .bg-red-600 {
      background-color: var(--btn-coral) !important;
      color: #ffffff !important;
    }
    .hover\:bg-rose-700:hover, .hover\:bg-red-700:hover {
      background-color: var(--btn-coral-hover) !important;
    }

    /* Soft Dusty Sky (KPI On List) */
    .bg-sky-700 {
      background-color: var(--btn-sky) !important;
      color: #ffffff !important;
    }

    /* Soft File Input Buttons */
    input[type="file"]::file-selector-button {
      background-color: var(--btn-pink) !important;
      color: #ffffff !important;
      border: none !important;
      border-radius: 0.75rem !important;
      padding: 0.5rem 1rem !important;
      font-weight: 600 !important;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }
    input[type="file"]::file-selector-button:hover {
      background-color: var(--btn-pink-hover) !important;
    }
    #qrisFileInput::file-selector-button {
      background-color: var(--btn-lavender) !important;
    }
    #qrisFileInput::file-selector-button:hover {
      background-color: var(--btn-lavender-hover) !important;
    }

    /* Soft KPI Dashboard Card Subtitle Contrast */
    .bg-slate-900 .text-slate-400, .bg-slate-900 .text-slate-300 {
      color: #fff0f6 !important;
    }
    .bg-slate-900 .text-emerald-400 {
      color: #ffffff !important;
    }
    .bg-slate-900 .text-rose-300 {
      color: #ffe4ee !important;
    }

    input:focus, select:focus, textarea:focus {
      border-color: #e18aaa !important;
      box-shadow: 0 0 0 2px rgba(225, 138, 170, 0.22) !important;
    }

    /* Invoice Cute Pastel Pink Silhouette Card */
    .inv-pink-card {
      position: relative;
      overflow: hidden;
      background: linear-gradient(180deg, #ffffff 0%, #fff9fb 100%) !important;
      border: 1.5px solid #f4c6d7 !important;
      box-shadow: 0 12px 32px -10px rgba(225, 138, 170, 0.20) !important;
    }
    .inv-pink-card::before {
      content: "";
      position: absolute;
      top: -60px;
      right: -55px;
      width: 210px;
      height: 210px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(225, 138, 170, 0.28) 0%, rgba(250, 226, 236, 0.14) 60%, transparent 75%);
      pointer-events: none;
      z-index: 0;
    }
    .inv-pink-card::after {
      content: "";
      position: absolute;
      bottom: -70px;
      left: -60px;
      width: 230px;
      height: 230px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(244, 198, 215, 0.42) 0%, rgba(253, 242, 247, 0.16) 60%, transparent 75%);
      pointer-events: none;
      z-index: 0;
    }
    .inv-pink-card > * { position: relative; z-index: 1; }
    .inv-pink-thead {
      background-color: #fdf2f7 !important;
      color: #a85474 !important;
    }
    .inv-pink-thead th { padding-top: 10px; padding-bottom: 10px; }
    .inv-pink-thead th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; padding-left: 10px; }
    .inv-pink-thead th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; padding-right: 10px; }
    .inv-thankyou-box {
      background: linear-gradient(135deg, #fdf2f7 0%, #fae6ef 100%);
      border: 1.5px dashed #e18aaa;
      color: #8f4362;
      border-radius: 1rem;
      padding: 14px 18px;
      text-align: center;
      margin-top: 22px;
    }

    /* Autocomplete & Excel Filter */
    .ac-list {
      position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
      background: #ffffff; border: 1px solid #ecc0d3; border-radius: 0.75rem;
      box-shadow: 0 10px 25px -5px rgba(225, 138, 170, 0.22);
      max-height: 180px; overflow-y: auto; z-index: 60;
    }
    .ac-item { padding: 8px 12px; cursor: pointer; font-size: 0.8125rem; border-bottom: 1px solid #fae6ef; }
    .ac-item:last-child { border-bottom: none; }
    .ac-item:hover { background: #fdf2f7; }
    .sortable { cursor: pointer; user-select: none; }
    .sortable:hover { color: #c96b8f; }
    .xl-filter-btn {
      display: inline-flex; align-items: center; justify-content: space-between; gap: 4px;
      width: 100%; padding: 4px 7px; font-size: 11px; font-weight: 500;
      border: 1px solid #ecc0d3; border-radius: 6px; background: #fff; color: #6e4559;
      cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden;
    }
    .xl-filter-btn.active { border-color: #e18aaa; background: #e18aaa; color: #ffffff; }
    .xl-popover {
      position: fixed; width: 240px; background: #ffffff;
      border: 1px solid #ecc0d3; border-radius: 12px;
      box-shadow: 0 20px 35px -10px rgba(225, 138, 170, 0.26);
      z-index: 80; padding: 10px;
    }
    #sidebar { transition: transform 0.22s ease; }
    #sidebar.closed { transform: translateX(-100%); }

    /* === MODE MALAM (COZY MIDNIGHT ROSE-PLUM DARK MODE) === */
    html.dark body {
      background-color: #161018 !important;
      background-image:
        radial-gradient(circle at 12% 14%, rgba(225, 138, 170, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 86% 82%, rgba(201, 107, 143, 0.12) 0%, transparent 42%);
      color: #f6e7ef !important;
    }
    html.dark .bg-white { background-color: #211724 !important; color: #f6e7ef !important; }
    html.dark .bg-slate-100, html.dark .bg-slate-100\/80 { background-color: #18111b !important; }
    html.dark .bg-slate-50 { background-color: #2a1d2e !important; }
    html.dark .border-slate-200, html.dark .border-slate-300 { border-color: #3d2842 !important; }
    html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: #322136 !important; }
    html.dark .text-slate-900, html.dark .text-slate-800 { color: #fdf2f8 !important; }
    html.dark .text-slate-700, html.dark .text-slate-600 { color: #d8bfd0 !important; }
    html.dark .text-slate-500, html.dark .text-slate-400 { color: #a7899f !important; }
    html.dark .hover\:bg-slate-50:hover, html.dark .hover\:bg-slate-100:hover { background-color: #2e1f33 !important; }
    html.dark input, html.dark select, html.dark textarea {
      background-color: #1a121d !important;
      color: #fdf2f8 !important;
      border-color: #4a3150 !important;
    }
    html.dark .ac-list, html.dark .xl-popover {
      background-color: #241928 !important;
      border-color: #4a3150 !important;
      color: #fdf2f8 !important;
    }
    html.dark .ac-item { border-color: #322136 !important; }
    html.dark .ac-item:hover { background-color: #322136 !important; }
    html.dark .xl-filter-btn { background-color: #1c131f !important; border-color: #4a3150 !important; color: #e2cada !important; }
    html.dark .xl-filter-btn.active { background-color: #d4799b !important; border-color: #d4799b !important; color: #fff !important; }
    html.dark .inv-pink-card {
      background: linear-gradient(180deg, #241828 0%, #1d1320 100%) !important;
      border-color: #5a3254 !important;
    }
    html.dark .inv-pink-thead {
      background-color: #321f36 !important;
      color: #f4b6ce !important;
    }
    html.dark .inv-thankyou-box {
      background: linear-gradient(135deg, #2d1a31 0%, #3a1f3c 100%) !important;
      border-color: #e18aaa !important;
      color: #f9d5e4 !important;
    }
    html.dark .bg-emerald-50 { background-color: #142c24 !important; border-color: #1f4d3d !important; }
    html.dark .text-emerald-800, html.dark .text-emerald-700 { color: #8ad6b8 !important; }
    html.dark .bg-blue-50 { background-color: #17253d !important; border-color: #253d66 !important; }
    html.dark .text-blue-800, html.dark .text-blue-700 { color: #a5c6eb !important; }
    html.dark .bg-amber-50 { background-color: #332414 !important; border-color: #593d1c !important; }
    html.dark .text-amber-800 { color: #f2c29b !important; }
    html.dark .bg-indigo-50 { background-color: #231e3d !important; border-color: #3b3266 !important; }
    html.dark .text-indigo-700 { color: #c7bcee !important; }
    html.dark #kpiNetProfit.text-red-600, html.dark #expKpiNet.text-red-600 { color: #fb7185 !important; }
    html.dark #kpiNetProfit.text-emerald-600, html.dark #expKpiNet.text-emerald-600 { color: #34d399 !important; }

    /* Force Light Pastel Pink Theme saat Print / PDF */
    @media print {
      .no-print { display: none !important; }
      html.dark body, body { background: #ffffff !important; color: #432434 !important; }
      html.dark .inv-pink-card, .inv-pink-card {
        background: #ffffff !important;
        color: #432434 !important;
        box-shadow: none !important;
        border: 1.5px solid #f4c6d7 !important;
        margin: 0 !important;
        max-width: 100% !important;
      }
      html.dark .inv-pink-card .text-slate-900, html.dark .inv-pink-card .text-slate-800 { color: #432434 !important; }
      html.dark .inv-pink-card .text-slate-700, html.dark .inv-pink-card .text-slate-600 { color: #6e4a5d !important; }
      html.dark .inv-pink-card .bg-slate-50 { background-color: #fdf2f7 !important; }
      html.dark .inv-pink-thead { background-color: #fdf2f7 !important; color: #a85474 !important; }
      html.dark .inv-thankyou-box { background: #fdf2f7 !important; border-color: #e18aaa !important; color: #8f4362 !important; }
    }

/* Warna Kontras Kurang (Merah) & Sisa (Biru) pada Invoice */
html.dark #pubBalanceRow.text-red-600, html.dark #invBalanceRow.text-red-600 { color: #fb7185 !important; }
html.dark #pubBalanceRow.text-blue-600, html.dark #invBalanceRow.text-blue-600 { color: #60a5fa !important; }
html.dark #pubBalanceRow.text-emerald-700, html.dark #invBalanceRow.text-emerald-700 { color: #34d399 !important; }
