/* KopWeb PWA + mobile shell (no accounting logic) */

:root {
  --kopweb-pwa-nav-height: 3.75rem;
  --kopweb-pwa-theme: #405189;
}

meta[name="theme-color"] {
  color: var(--kopweb-pwa-theme);
}

/* Notch / status bar — fixed topbar must clear safe area */
#page-topbar {
  padding-top: env(safe-area-inset-top, 0px);
}

/* Bottom navigation — mobile only */
.kopweb-pwa-bottom-nav {
  display: none;
}

.kopweb-pwa-meta-footer {
  display: none;
}

@media (max-width: 991.98px) {
  body.has-kopweb-pwa-bottom-nav {
    padding-bottom: calc(var(--kopweb-pwa-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  /*
   * Footer Velzon (© nama panjang + Design by) redundant dengan header + bottom nav,
   * dan di HP sering >60px (dua kolom stack) sehingga tertutup nav.
   */
  body.has-kopweb-pwa-bottom-nav .footer {
    display: none;
  }

  body.has-kopweb-pwa-bottom-nav .page-content {
    /* Footer absolut Velzon disembunyikan — cukup jarak kecil sebelum strip meta */
    padding-bottom: 1rem;
  }

  /* Meta versi: di alur scroll (akhir halaman), bukan sticky di atas nav */
  body.has-kopweb-pwa-bottom-nav .kopweb-pwa-meta-footer {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.5rem 0.75rem 0.75rem;
    text-align: center;
  }

  .kopweb-pwa-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    height: calc(var(--kopweb-pwa-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 0.25rem 0.35rem env(safe-area-inset-bottom, 0px);
    background: var(--vz-secondary-bg, #fff);
    border-top: 1px solid var(--vz-border-color, #e9ebec);
    box-shadow: 0 -0.25rem 0.75rem rgba(15, 23, 42, 0.06);
    justify-content: space-around;
    align-items: stretch;
  }

  .kopweb-pwa-bottom-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.35rem 0.25rem;
    text-decoration: none;
    color: var(--vz-body-color, #878a99);
    font-size: 0.65rem;
    line-height: 1.1;
    border-radius: 0.5rem;
  }

  .kopweb-pwa-bottom-nav__item i {
    font-size: 1.25rem;
    line-height: 1;
  }

  .kopweb-pwa-bottom-nav__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kopweb-pwa-bottom-nav__item.is-active,
  .kopweb-pwa-bottom-nav__item:hover {
    color: var(--vz-primary, #405189);
  }

  /* Field shortcuts — show prominently on mobile dashboard */
  .kopweb-pwa-field-shortcuts {
    display: block;
  }
}

@media (min-width: 992px) {
  .kopweb-pwa-field-shortcuts {
    display: none;
  }
}

.kopweb-pwa-field-shortcuts .card {
  border: 1px solid var(--vz-border-color, #e9ebec);
}

.kopweb-pwa-field-shortcuts__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.kopweb-pwa-field-shortcuts__link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  background: var(--vz-light, #f3f6f9);
  color: inherit;
  min-height: 4.5rem;
}

.kopweb-pwa-field-shortcuts__link i {
  font-size: 1.35rem;
}

.kopweb-pwa-field-shortcuts__link strong {
  font-size: 0.875rem;
}

.kopweb-pwa-field-shortcuts__link span {
  font-size: 0.7rem;
  color: var(--vz-body-color, #878a99);
}

.kopweb-pwa-field-shortcuts__link--primary {
  background: rgba(64, 81, 137, 0.08);
  color: var(--vz-primary, #405189);
}

.kopweb-pwa-field-shortcuts__link--success {
  background: rgba(10, 179, 156, 0.1);
  color: var(--vz-success, #0ab39c);
}

.kopweb-pwa-field-shortcuts__link--warning {
  background: rgba(247, 184, 75, 0.12);
  color: var(--vz-warning, #f7b84b);
}

.kopweb-pwa-field-shortcuts__link--info {
  background: rgba(41, 156, 219, 0.1);
  color: var(--vz-info, #299cdb);
}

.kopweb-pwa-field-shortcuts__note {
  font-size: 0.75rem;
  color: var(--vz-body-color, #878a99);
  margin-top: 0.75rem;
  margin-bottom: 0;
}
