:root {
  --brand-green: #1e8449;
  --brand-green-dark: #16693a;
  --brand-green-light: #e8f6ee;
}

body {
  background-color: #f4f6f8;
}

.app-navbar {
  background-color: var(--brand-green);
}

.sidebar {
  min-height: 100vh;
  background-color: #1c2b22 !important;
}

.sidebar .nav-link {
  border-radius: .5rem;
  margin: 2px 10px;
  opacity: .85;
}

.sidebar .nav-link:hover {
  background-color: rgba(255,255,255,.08);
  opacity: 1;
}

.sidebar .nav-link.active {
  background-color: var(--brand-green);
  opacity: 1;
}

.btn-brand, .btn-brand:hover {
  background-color: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}

.card-purchase {
  border: none;
  border-left: 4px solid var(--brand-green);
  border-radius: .6rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-purchase .label {
  color: var(--brand-green-dark);
  font-weight: 600;
  font-size: .85rem;
}

.stat-card {
  border: none;
  border-radius: .8rem;
  color: #fff;
}

.login-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
}

.login-card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  max-width: 420px;
  width: 100%;
}

@media (max-width: 480px) {
  .login-card {
    border-radius: .75rem;
  }
  .login-card .card-body {
    padding: .5rem;
  }
}

.foto-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: .4rem;
  cursor: pointer;
}

.foto-preview {
  max-width: 100%;
  max-height: 320px;
  border-radius: .5rem;
}

.bg-brand {
  background-color: var(--brand-green) !important;
  color: #fff;
}

.notif-bell {
  position: relative;
  color: #fff;
}

.notif-bell .notif-dot {
  position: absolute;
  top: -2px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  background-color: #dc3545;
  color: #fff;
  font-size: .65rem;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

.notif-dropdown {
  width: 340px;
  max-width: 90vw;
  max-height: 420px;
  overflow-y: auto;
  padding: 0;
}

.notif-item {
  white-space: normal;
  border-bottom: 1px solid #eee;
}

.notif-item.unread {
  background-color: var(--brand-green-light);
}

.notif-item small {
  display: block;
  color: #888;
}

/* =========================================================
   Mobile: bikin semua elemen lebih besar & enak dibaca di HP
   ========================================================= */
@media (max-width: 767.98px) {
  body {
    font-size: 1rem;
  }

  h3, .h3 { font-size: 1.4rem; }
  h4, .h4 { font-size: 1.2rem; }
  h5, .h5 { font-size: 1.05rem; }

  main {
    padding: 1rem !important;
  }

  /* Navbar: brand jangan kepotong, tombol-tombol lebih longgar */
  .app-navbar .navbar-brand {
    font-size: 1.05rem;
  }
  .app-navbar .container-fluid {
    gap: .5rem;
  }

  /* Kartu ringkasan dashboard: angka & label lebih besar & jelas */
  .stat-card {
    padding: 1rem !important;
  }
  .stat-card .small {
    font-size: .82rem;
    font-weight: 600;
    opacity: .95;
  }
  .stat-card .fs-2 {
    font-size: 1.9rem !important;
  }

  /* Tombol: target sentuh lebih besar */
  .btn {
    padding: .55rem 1rem;
    font-size: 1rem;
  }
  .btn-sm {
    padding: .4rem .75rem;
    font-size: .9rem;
  }

  /* Form: input lebih besar biar gampang diketik di HP */
  .form-control, .form-select {
    font-size: 1rem;
    padding: .6rem .8rem;
  }
  .form-label {
    font-size: .95rem;
    font-weight: 600;
  }

  .card-body {
    padding: 1rem;
  }
}

/* =========================================================
   Tabel jadi tampilan kartu bertumpuk di layar sempit, supaya
   tidak perlu geser ke samping / tulisan super kecil.
   Dipasang otomatis lewat assets/js/mobile-tables.js.
   ========================================================= */
@media (max-width: 767.98px) {
  table.table-mobile-cards thead {
    display: none;
  }
  table.table-mobile-cards, table.table-mobile-cards tbody,
  table.table-mobile-cards tr, table.table-mobile-cards td {
    display: block;
    width: 100%;
  }
  table.table-mobile-cards tr {
    margin-bottom: .85rem;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    padding: .5rem .75rem;
    background: #fff;
  }
  table.table-mobile-cards tr:hover {
    background: #fff;
  }
  table.table-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .45rem 0;
    border: none;
    border-bottom: 1px dashed #eee;
    font-size: .95rem;
    text-align: right;
  }
  table.table-mobile-cards td:last-child {
    border-bottom: none;
  }
  table.table-mobile-cards td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    text-align: left;
    flex-shrink: 0;
  }
  table.table-mobile-cards td:not([data-label]),
  table.table-mobile-cards td[data-label=""] {
    justify-content: center;
  }
  table.table-mobile-cards td.mobile-action-cell {
    justify-content: center;
    padding-top: .6rem;
  }
  table.table-mobile-cards td.mobile-action-cell::before {
    content: none;
  }
}
