body {
  background-color: #f4f6f9;
}

/* Sembunyikan bottom-nav mobile selagi menu sidebar (offcanvas) terbuka agar tidak terlihat mengintip di bawah sidebar */
body.menu-open .bottom-nav {
  display: none;
}

.toggle-password .icon-hide {
  display: none;
}

.toggle-password.is-visible .icon-show {
  display: none;
}

.toggle-password.is-visible .icon-hide {
  display: inline-flex;
}

.bulk-toolbar {
  display: flex;
  background-color: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  margin-bottom: 0.75rem;
}

:root {
  --sidebar-bg: #008080;
  --sidebar-text: #ffffff;
  --sidebar-active: #005c5c;
}

#appMenu.offcanvas-md {
  --bs-offcanvas-width: 260px;
  background-color: var(--sidebar-bg) !important;
  color: var(--sidebar-text);
  overflow-x: hidden;
}

#appMenu .offcanvas-body {
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}

@media (min-width: 768px) {
  .app-layout {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
  }

  #appMenu.offcanvas-md {
    width: 240px;
    flex: 0 0 240px;
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .app-content {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .app-layout.sidebar-collapsed #appMenu.offcanvas-md {
    width: 76px;
    flex: 0 0 76px;
  }

  .app-layout.sidebar-collapsed .sidebar-brand {
    padding: 0.75rem 0.5rem;
    height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
  }

  .app-layout.sidebar-collapsed .sidebar-brand .nav-label,
  .app-layout.sidebar-collapsed .sidebar-nav .nav-label,
  .app-layout.sidebar-collapsed .sidebar-footer .nav-label {
    display: none;
  }

  .app-layout.sidebar-collapsed .sidebar-nav .list-group-item {
    display: flex;
    justify-content: center;
  }

  .app-layout.sidebar-collapsed .sidebar-footer {
    display: flex;
    justify-content: center;
  }

  .icon-expand {
    display: none;
  }

  .app-layout.sidebar-collapsed .icon-collapse {
    display: none;
  }

  .app-layout.sidebar-collapsed .icon-expand {
    display: inline-flex;
  }
}

.sidebar-brand {
  height: 4.2rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand svg {
  flex-shrink: 0;
}

.sidebar-logo-img {
  height: 40px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  border-radius: 0.25rem;
  background-color: #fff;
}

.sidebar-brand span {
  font-size: 0.95rem;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0;
}

.sidebar-nav .list-group-item {
  background: transparent;
  color: var(--sidebar-text);
  border: none;
  border-radius: 0.5rem;
  margin: 0.15rem 0.65rem;
  padding: 0.55rem 0.75rem;
}

.sidebar-nav .list-group-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-nav .list-group-item.active {
  background-color: var(--sidebar-active);
  color: #fff;
}

.menu-grid-title {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem 0.25rem;
}

.menu-grid-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem 0.5rem;
  padding: 0.5rem 1rem 1rem;
}

.menu-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--sidebar-text);
}

.menu-grid-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.menu-grid-label {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.2;
}

.sidebar-brand span.text-truncate {
  min-width: 0;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
  flex-shrink: 0;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  margin: 0 0.65rem;
  border-radius: 0.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
}

.sidebar-logout:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mobile-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eef0f2;
  background-color: #fff;
  text-decoration: none;
  color: inherit;
}

.mobile-list-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #e7f1ff;
  color: #0d6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}
.mobile-list-body {
  flex: 1 1 auto;
  min-width: 0;
}

.mobile-list-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-list-subtitle {
  color: #6c757d;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-list-meta {
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.85rem;
  color: #198754;
}

.mobile-list-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.mobile-list-actions a,
.mobile-list-actions button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  color: #6c757d;
  background: #fff;
  padding: 0;
}

.mobile-list-actions svg {
  margin-right: 0;
}

.mobile-list-actions a.text-danger,
.mobile-list-actions button.text-danger {
  color: #dc3545;
  border-color: #f8d7da;
}

.mobile-list-empty {
  text-align: center;
  color: #6c757d;
  padding: 2rem 0;
}

.mobile-paginate-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0 1rem;
}

.mobile-paginate-info {
  white-space: nowrap;
}

/* ===== Bagan garis (SVG, tanpa dependensi JS) untuk halaman Statistik ===== */
.chart-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.line-chart-wrap {
  min-width: 480px;
}

.line-chart-scroll {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.line-chart {
  width: 100%;
  height: 260px;
  overflow: visible;
}

.line-chart-grid {
  stroke: #e9ecef;
  stroke-width: 1;
}

.line-chart-grid-zero {
  stroke: #adb5bd;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.line-chart-area {
  fill: rgba(25, 135, 84, 0.08);
  stroke: none;
}

.line-chart-line {
  fill: none;
  stroke-width: 2.5;
}

.line-chart-line-success {
  stroke: #198754;
}

.line-chart-line-primary {
  stroke: #0d6efd;
}

.line-chart-dot {
  stroke: #fff;
  stroke-width: 1.5;
}

.line-chart-dot-success {
  fill: #198754;
}

.line-chart-dot-primary {
  fill: #0d6efd;
}

.line-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #6c757d;
}

@media (max-width: 767.98px) {
  #appMenu.offcanvas-md {
    height: 100dvh;
  }
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background-color: #fff;
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  z-index: 1030;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.4rem 0 0.3rem;
  color: #6c757d;
  text-decoration: none;
  font-size: 0.7rem;
  line-height: 1;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: #0d6efd;
}

@media (max-width: 767.98px) {
  main {
    padding-bottom: 4.5rem !important;
  }
}

/* ===== Halaman Login ===== */
body.login-page {
  margin: 0;
  background-color: #f8f9fb;
}

.login-shell {
  display: flex;
  min-height: 100vh;
}

.login-aside {
  flex: 0 0 44%;
  max-width: 560px;
  padding: 3rem;
  color: #fff;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0d6efd 130%);
  position: relative;
  overflow: hidden;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.login-brand-logo {
  height: 56px;
  width: 56px;
  object-fit: contain;
  border-radius: 0.6rem;
  background: #fff;
  padding: 6px;
}

.login-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  width: 56px;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.15);
}

.login-brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}

.login-aside-content h2 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.login-aside-content p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 30rem;
}

.login-aside-footer {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.login-form-wrap {
  flex: 1 1 auto;
  padding: 2rem 1.5rem;
}

.login-form-card {
  width: 100%;
  max-width: 400px;
}

.login-form-card h4 {
  font-weight: 700;
}

.login-copyright {
  font-size: 0.75rem;
}

/* ===== Halaman Login - Mobile ===== */
.login-mobile {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f4f6f5;
}

.login-mobile-header {
  background: linear-gradient(160deg, #1f5c47 0%, #164536 100%);
  border-radius: 0 0 2.5rem 2.5rem;
  padding: 3rem 1.5rem 4.5rem;
  text-align: center;
  color: #fff;
}

.login-mobile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: #164536;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.login-mobile-badge-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
  border-radius: 0.4rem;
}

.login-mobile-badge-icon {
  display: inline-flex;
  color: #1f5c47;
}

.login-mobile-tagline {
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.login-mobile-card {
  background: #fff;
  border-radius: 1.5rem;
  margin: -3rem 1rem 0;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  flex: 1 1 auto;
}

.login-mobile-card h4 {
  font-weight: 700;
}

.login-mobile-form .input-group {
  background: #f1f3f5;
  border-radius: 999px;
  overflow: hidden;
}

.login-mobile-form .input-group-text,
.login-mobile-form .form-control,
.login-mobile-form .toggle-password {
  background: transparent;
  border: none;
  box-shadow: none;
}

.login-mobile-form .input-group-text {
  color: #6c757d;
  padding-left: 1.1rem;
}

.login-mobile-form .form-control {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.login-mobile-form .form-control:focus {
  box-shadow: none;
}

.btn-mobile-login {
  background-color: #1f5c47;
  border-color: #1f5c47;
  color: #fff;
  border-radius: 0.75rem;
  padding: 0.65rem;
  font-weight: 600;
}

.btn-mobile-login:hover,
.btn-mobile-login:active {
  background-color: #164536;
  border-color: #164536;
  color: #fff;
}

.login-mobile-footer {
  text-align: center;
  color: #9aa0a6;
  font-size: 0.75rem;
  padding: 1.5rem 1rem;
  margin: 0;
}

/* ===== Splash Screen ===== */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0d6efd 130%);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-splash.app-splash-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-inner {
  text-align: center;
  color: #fff;
}

.app-splash-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 1.25rem;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: splashPop 0.6s ease;
}

.app-splash-title {
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  animation: splashFadeUp 0.6s ease 0.1s both;
}

.app-splash-spinner {
  margin: 1.5rem auto 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: splashSpin 0.8s linear infinite;
}

.app-splash-success {
  background: linear-gradient(135deg, #0f5132 0%, #198754 55%, #20c997 130%);
}

.app-splash-check {
  display: inline-flex;
  animation: splashPop 0.5s ease;
  color: #fff;
}

.app-splash-subtitle {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  animation: splashFadeUp 0.6s ease 0.15s both;
}

@keyframes splashPop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes splashFadeUp {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes splashSpin {
  to {
    transform: rotate(360deg);
  }
}

.print-only-block {
  display: none;
}

/* Garis horisontal tabel invoice dibuat hitam tegas agar jelas terbaca saat dilihat maupun dicetak. */
.table-invoice-lines {
  --bs-table-border-color: #000;
}

.table-invoice-lines > :not(caption) > * > * {
  border-bottom-color: #000 !important;
  border-bottom-width: 1.5px !important;
}

/* Baris terakhir tidak perlu border-bottom sendiri agar tidak menumpuk dengan garis pembungkus kartu (menghindari efek berbayang/tebal). */
.table-invoice-lines tr.row-no-border-bottom > * {
  border-bottom: none !important;
}

/* Semua teks pada invoice dibuat hitam jelas, termasuk teks yang biasanya pudar (text-muted). */
.invoice-content,
.invoice-content .text-muted {
  color: #000 !important;
}

/* Garis pembungkus tabel & kartu nomor invoice dibuat hitam tegas dengan sudut siku (tidak melengkung). */
.invoice-border-dark {
  --bs-card-border-color: #000;
  border-radius: 0;
}

.invoice-border-dark .card-header,
.invoice-border-dark .table-responsive,
.invoice-border-dark .table {
  border-radius: 0;
}

/* Khusus kartu nomor invoice, sudut tetap melengkung seperti semula. */
.invoice-border-rounded {
  border-radius: var(--bs-card-border-radius) !important;
}

/* Batasi tinggi tabel (header + tepat 20 baris) lalu scroll jika datanya lebih banyak dari itu. */
.table-scroll {
  max-height: 1010px;
  overflow-y: auto;
}

.table-scroll table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8f9fa;
}

/* Varian untuk tabel Pemasukan/Pengeluaran: scroll baru muncul setelah kira-kira 10 baris. */
.table-scroll-10 {
  max-height: 460px;
  overflow-y: auto;
}

.table-scroll-10 table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8f9fa;
}

/* Varian untuk tabel laporan: scroll baru muncul setelah kira-kira 15 baris. */
.table-scroll-15 {
  max-height: 730px;
  overflow-y: auto;
}

.table-scroll-15 table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8f9fa;
}

@media print {
  @page {
    margin: 0.3cm 0.6cm;
  }

  /* Setiap kartu invoice dijaga tetap utuh, tidak terpotong di antara dua halaman cetak. */
  .invoice-content .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  nav, .offcanvas, .offcanvas-md, .no-print {
    display: none !important;
  }

  /* Cetak selalu pakai tampilan tabel desktop, bukan daftar kartu mobile, berapa pun lebar layarnya. */
  .d-md-none {
    display: none !important;
  }

  .d-none.d-md-block {
    display: block !important;
  }

  .print-only-block, .print-title {
    display: block !important;
  }

  /* Paksa "Informasi Pembayaran" & "Syarat dan Ketentuan" tetap sejajar 2 kolom saat print,
     berapa pun lebar halaman cetaknya (breakpoint col-md-6 kadang tidak terpicu saat print). */
  .row-print-2col {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
  }

  .row-print-2col > [class*="col-"] {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  /* Jika hanya salah satu tanda tangan dicentang, tampilkan di kiri, sejajar Info Rekening Pembayaran. */
  .ttd-single-print .row {
    justify-content: flex-start !important;
  }

  .ttd-single-print .col-12 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    text-align: center !important;
  }

  .row.g-3 {
    row-gap: 0.5rem !important;
  }

  .card-stat {
    color: #000 !important;
    background: none !important;
    border: 1px solid #dee2e6 !important;
  }

  .card-stat .card-body {
    padding: 0.5rem 0.75rem !important;
    min-height: 0 !important;
    gap: 0.25rem;
  }

  .card-stat .stat-icon {
    display: none !important;
  }

  .card-stat .value {
    font-size: 1.1rem !important;
  }

  .card-stat .value.value-money {
    font-size: 1.1rem !important;
  }

  .signature-block {
    border: none !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .profile-usaha-block {
    border: none !important;
    border-bottom: 1px solid #dee2e6 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding-bottom: 0.75rem;
  }

  /* Nonaktifkan pembatasan tinggi/scroll agar tabel tidak tercetak dobel (terpotong di frame scroll + tercetak ulang penuh di halaman berikutnya) */
  .table-responsive.table-scroll,
  .table-responsive.table-scroll-10,
  .table-responsive.table-scroll-15 {
    max-height: none !important;
    overflow: visible !important;
  }

  .table-scroll table thead th,
  .table-scroll table tfoot th,
  .table-scroll table tfoot td,
  .table-scroll-10 table thead th,
  .table-scroll-10 table tfoot th,
  .table-scroll-10 table tfoot td,
  .table-scroll-15 table thead th,
  .table-scroll-15 table tfoot th,
  .table-scroll-15 table tfoot td {
    position: static !important;
  }

  /* Cegah <tfoot> (baris Total) tercetak berulang di setiap halaman saat tabel terpotong ke halaman berikutnya */
  table tfoot {
    display: table-row-group;
  }
}

