.dashboard-body {
  background-color: var(--warm-cream);
  min-height: 100vh;
  padding-bottom: 80px; /* space for bottom nav on mobile */
}

.dashboard-navbar {
  background-color: var(--dark-earth);
}

.dash-nav-link {
  color: rgba(250, 246, 240, 0.85);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.dash-nav-link:hover {
  color: var(--amber-gold);
}

.dashboard-main {
  padding: 20px 0 10px;
}

/* ---------- Sidebar (Desktop) ---------- */
.dashboard-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--dark-earth);
  z-index: 1040;
  padding: 22px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warm-cream);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(250, 246, 240, 0.1);
  margin-bottom: 18px;
}

.sidebar-brand i { color: var(--amber-gold); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(250, 246, 240, 0.72);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
  background: rgba(250, 246, 240, 0.06);
  color: var(--warm-cream);
}

.sidebar-nav-link.active {
  background: var(--amber-gold);
  color: var(--dark-earth);
}

.sidebar-nav-link-super {
  border: 1px solid rgba(201, 138, 44, 0.4);
  color: var(--amber-gold) !important;
  margin-top: 8px;
}

.sidebar-nav-link-super:hover {
  background: var(--amber-gold);
  color: var(--dark-earth) !important;
}

.sidebar-footer {
  border-top: 1px solid rgba(250, 246, 240, 0.1);
  padding-top: 16px;
  margin-top: 16px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(250, 246, 240, 0.9);
  margin-bottom: 14px;
  padding: 8px;
  background: rgba(250, 246, 240, 0.05);
  border-radius: 12px;
}

.sidebar-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--amber-gold);
  color: var(--dark-earth);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-user-info strong {
  font-size: 0.88rem;
  color: var(--warm-cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: var(--amber-gold);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Dashboard Mobile Off-canvas ---------- */
.dashboard-toggler {
  border: 1px solid rgba(201, 138, 44, 0.55);
  background-color: rgba(201, 138, 44, 0.14);
  border-radius: 8px;
  padding: 7px 10px;
}

.dashboard-toggler .navbar-toggler-icon {
  width: 1.2em;
  height: 1.2em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23C98A2C' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.sidebar-avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

.dashboard-sidebar-offcanvas {
  width: 260px;
  background: var(--dark-earth);
  color: var(--warm-cream);
  padding: 8px 16px 16px;
}

.dashboard-sidebar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(250, 246, 240, 0.1);
  padding: 14px 4px;
  margin-bottom: 12px;
}

.dashboard-sidebar-offcanvas .btn-close {
  filter: invert(1) grayscale(100%) brightness(2);
  opacity: 0.8;
}

@media (min-width: 768px) {
  .dashboard-main-with-sidebar {
    margin-left: 240px;
  }
}

/* ---------- Login Page ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--dark-earth) 0%, var(--forest-green) 100%);
  padding: 20px;
}

.login-card {
  background: var(--warm-cream);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* ---------- Stat Cards ---------- */
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border-left: 5px solid var(--amber-gold);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(28, 17, 10, 0.12);
}

.stat-card .stat-icon {
  font-size: 1.8rem;
  color: var(--amber-gold);
}

.stat-card .stat-value {
  font-size: clamp(1.1rem, 4vw, 1.7rem);
  font-weight: 800;
  color: var(--dark-earth);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card .stat-label {
  color: #7a6a5c;
  font-size: 0.85rem;
}

/* Kadi zinazoonyesha kiasi cha fedha (TZS ...) - fonti ndogo zaidi kuliko
   kadi za idadi (counts) kwa sababu namba za fedha ni ndefu zaidi. */
.stat-card .stat-value-amount {
  font-size: clamp(0.9rem, 3vw, 1.3rem);
}

.stat-card.stat-green { border-left-color: var(--forest-green); }
.stat-card.stat-dark { border-left-color: var(--dark-earth); }

/* ---------- Search Box ---------- */
.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a8988a;
}

.search-box .form-control {
  padding-left: 40px;
  border-radius: 999px;
  border-color: rgba(28, 17, 10, 0.12);
}

.search-box .form-control:focus {
  border-color: var(--amber-gold);
  box-shadow: 0 0 0 3px rgba(201, 138, 44, 0.15);
}

/* ---------- Manual Hali Select ---------- */
.hali-select {
  border-radius: 10px;
  border-color: rgba(28, 17, 10, 0.15);
  font-weight: 600;
  font-size: 0.85rem;
}

.hali-select:focus {
  border-color: var(--amber-gold);
  box-shadow: 0 0 0 3px rgba(201, 138, 44, 0.15);
}

/* ---------- Pagination ---------- */
.pagination-dash {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(28, 17, 10, 0.12);
  background: #fff;
  color: var(--dark-earth);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--amber-gold);
  color: var(--amber-gold);
}

.page-btn.active {
  background: var(--forest-green);
  border-color: var(--forest-green);
  color: #fff;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 6px;
  color: #a8988a;
}

/* ---------- Filter Tabs ---------- */
.hali-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hali-tabs::-webkit-scrollbar {
  height: 4px;
}

.hali-tab-btn {
  white-space: nowrap;
  border: 1px solid rgba(28, 17, 10, 0.15);
  background: #fff;
  color: var(--dark-earth);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.hali-tab-btn:hover {
  border-color: var(--amber-gold);
}

.hali-tab-btn.active {
  background: var(--forest-green);
  border-color: var(--forest-green);
  color: #fff;
}

/* ---------- Order Cards (mobile list) ---------- */
.order-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(28, 17, 10, 0.06);
  transition: box-shadow 0.2s ease;
}

.order-card:hover {
  box-shadow: 0 8px 20px rgba(28, 17, 10, 0.1);
}

.order-card .order-namba {
  font-weight: 700;
  color: var(--dark-earth);
}

.order-card .order-kiasi {
  font-weight: 800;
  color: var(--forest-green);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-hali {
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-hali-inasubiri { background: #fff3cd; color: #8a6d1a; }
.badge-hali-imelipwa { background: #d4edda; color: #1e5c2f; }
.badge-hali-imesafirishwa { background: #cfe2ff; color: #1a4a8a; }
.badge-hali-imekamilika { background: #2C3E2E; color: #fff; }
.badge-hali-imeghairiwa { background: #f8d7da; color: #842029; }

/* ---------- Bottom Nav (Mobile) ---------- */
.dashboard-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark-earth);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  z-index: 1030;
}

.bottom-nav-item {
  color: rgba(250, 246, 240, 0.65);
  text-decoration: none;
  text-align: center;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.bottom-nav-item i {
  font-size: 1.3rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--amber-gold);
}

/* ---------- Order Detail ---------- */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(28, 17, 10, 0.08);
}

.detail-row:last-child {
  border-bottom: none;
}

@media (max-width: 767px) {
  .dashboard-main { padding: 14px 0 10px; }

  .stat-card {
    padding: 12px;
    border-left-width: 4px;
    border-radius: 12px;
  }

  .stat-card .stat-icon {
    font-size: 1.3rem;
  }

  .stat-card .stat-value {
    font-size: 1.1rem;
  }

  .stat-card .stat-value-amount {
    font-size: 0.85rem;
  }

  .stat-card .stat-label {
    font-size: 0.72rem;
  }
}

@media (max-width: 400px) {
  .stat-card .stat-value { font-size: 0.95rem; }
  .stat-card .stat-value-amount { font-size: 0.75rem; }
  .stat-card .stat-icon { font-size: 1.1rem; }
}

/* ---------- Malipo (Payments) Page ---------- */
.malipo-filters {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(28, 17, 10, 0.06);
}

.malipo-table-wrap {
  background: #fff;
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 4px 14px rgba(28, 17, 10, 0.06);
}

.malipo-table {
  margin-bottom: 0;
  min-width: 760px;
}

.malipo-table thead th {
  background: var(--dark-earth);
  color: var(--warm-cream);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border: none;
  padding: 14px 12px;
  white-space: nowrap;
}

.malipo-table thead th:first-child { border-top-left-radius: 16px; }
.malipo-table thead th:last-child { border-top-right-radius: 16px; }

.malipo-table tbody td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(28, 17, 10, 0.06);
}

.malipo-table tbody tr:hover {
  background: rgba(201, 138, 44, 0.04);
}
