:root {
  --green-primary: #1e6641;
  --green-dark: #145235;
  --green-light: rgba(193, 241, 212, 0.622);
  --text-dark: #1a1a1a;
  --text-muted: #8a8fa3;
  --card-bg: #f7f7f7;
  /* --body-bg: #f4f6f5; */
  --body-bg: #fff;
  --border: #e8eceb;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  --red: #b93535;
  --red-light: #f5e0e0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Poppins, Arial, sans-serif;
  background: var(--body-bg);
  color: var(--text-dark);
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 240px;
  height: 100vh;
  background: var(--card-bg);
  border-radius: 10px;
  margin: 5px 10px 10px 0px;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 24px;
  /* border-bottom: 1px solid var(--border); */
}

.nav-section {
  padding: 8px 0 0;
  flex: 1;
  overflow-y: auto;
  /* overflow-y: scroll; */
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 21px;
  padding: 12px 14px 12px 22px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.18s;
  margin-bottom: 1px;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--green-light);
  color: var(--green-primary);
}

.nav-item.active {
  position: relative;
  background: var(--green-light);
  color: var(--green-primary);
  font-weight: 600;
  border-radius: 0 8px 8px 0;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0px;
  bottom: 0px;
  width: 5px;
  background: var(--green-primary);
  border-radius: 2px;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ─── Nav Submenu ─── */
.nav-group {
  position: relative;
}

.nav-has-sub {
  display: flex;
  align-items: center;
}

.nav-has-sub span {
  flex: 1;
}

.nav-chevron {
  font-size: 12px !important;
  width: auto !important;
  transition: transform 0.25s ease;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-chevron.open {
  transform: rotate(180deg);
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease;
  opacity: 0;
  padding-left: 16px;
}
.nav-submenu.open {
  max-height: 500px;
  opacity: 1;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  text-decoration: none;
  transition:
    color 0.18s,
    background 0.18s;
  margin-bottom: 1px;
}
.nav-sub-item:hover {
  color: var(--green-primary);
  background: var(--green-light);
}
.nav-sub-item.active {
  color: var(--green-primary);
  font-weight: 600;
}

.nav-sub-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.18s;
}
.nav-sub-item:hover .nav-sub-dot,
.nav-sub-item.active .nav-sub-dot {
  background: var(--green-primary);
}

/* ─── Topbar ─── */
.topbar {
  position: fixed;
  /* top: 5px; */
  margin: 5px 10px;
  border-radius: 10px;
  left: 240px;
  right: 0;
  height: 68px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 14px;
  z-index: 1030;
  transition: left 0.3s ease;
}

.search-wrap {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 13.5px;
  /* font-family: "DM Sans", sans-serif; */
  background: var(--body-bg);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus {
  border-color: var(--green-primary);
}
.search-wrap i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.notif-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.notif-btn:hover {
  background: var(--green-light);
}
.notif-dot {
  width: 8px;
  height: 8px;
  background: #e74c3c;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
  border: 1.5px solid #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-light);
}
.user-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
}
.user-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ─── Main ─── */
.main-content {
  /* background-color: var(--card-bg); */
  margin-left: 240px;
  padding-top: 68px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}
.page-body {
  padding: 26px;
  background-color: var(--card-bg);
  margin: 15px 10px;
  border-radius: 10px;
}

/* ─── Page Header ─── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  /* font-family: "Fraunces", serif; */
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 3px;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
}

.date-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: none;
}

/* ─── Calendar Dropdown ─── */
.cal-dropdown-wrap {
  position: relative;
}

/* Desktop/tablet: positioned dropdown */
.cal-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--card-bg);

  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  padding: 20px;
  z-index: 2000;
  width: 660px;
  max-width: calc(100vw - 32px);
}

.cal-inputs-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cal-text-input {
  flex: 1;
  min-width: 120px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  /* font-family: "DM Sans", sans-serif; */
  background: var(--body-bg);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
}
.cal-text-input:focus {
  border-color: var(--green-primary);
}

.cal-panels {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-panel {
  flex: 1;
  min-width: 240px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-month-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}
.cal-nav {
  display: flex;
  gap: 4px;
}

.cal-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1;
  transition: background 0.15s;
}
.cal-nav-btn:hover {
  background: var(--green-light);
  color: var(--green-primary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dow {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding: 3px 0 8px;
}

.cal-day {
  text-align: center;
  padding: 6px 2px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-dark);
  user-select: none;
  position: relative;
  transition: background 0.12s;
}
.cal-day:hover:not(.cal-empty):not(.cal-sel-start):not(.cal-sel-end) {
  background: var(--green-light);
}
.cal-day.cal-empty {
  cursor: default;
  pointer-events: none;
}
.cal-day.cal-sel-start,
.cal-day.cal-sel-end {
  background: var(--green-primary);
  color: #fff;
  border-radius: 6px;
}
.cal-day.cal-in-range {
  background: var(--green-light);
  color: var(--green-primary);
  border-radius: 0;
}
.cal-day.cal-range-start {
  border-radius: 6px 0 0 6px;
}
.cal-day.cal-range-end {
  border-radius: 0 6px 6px 0;
}
.cal-day.cal-today:not(.cal-sel-start):not(.cal-sel-end)::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green-primary);
}

.cal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.cal-btn-cancel {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 13.5px;
  /* font-family: "DM Sans", sans-serif; */
  cursor: pointer;
  font-weight: 500;
  color: var(--text-dark);
  transition: background 0.15s;
}
.cal-btn-cancel:hover {
  background: var(--body-bg);
}

.cal-btn-apply {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: var(--green-primary);
  color: #fff;
  font-size: 13.5px;
  /* font-family: "DM Sans", sans-serif; */
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.cal-btn-apply:hover {
  background: var(--green-dark);
}

/* ─── Stat Card ─── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  height: 100%;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}
.stat-card.featured {
  /* background: var(--green-primary); */
  background: linear-gradient(135deg, #145b37, #238555);
  color: #fff;

  border-color: transparent;
}
.stat-card.featured .stat-label {
  color: white;
}
.stat-card.featured .stat-value {
  color: white;
}
.stat-card.featured .arrow-btn {
  /* border-color: rgba(255, 255, 255, 0.35); */
  background-color: white;
  color: black;
}
.stat-card.featured .arrow-btn:hover {
  background: rgba(255, 255, 255, 0.959);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
}

.arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 13px;
  transition: all 0.2s;
  background: transparent;
  flex-shrink: 0;
}
.arrow-btn:hover {
  background: var(--green-primary);
  border-color: var(--green-primary);
  color: #fff;
}

.stat-value {
  /* font-family: "Fraunces", serif; */
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: #51514e;
}
.stat-unit {
  font-size: 18px;
  font-weight: 500;
  /* font-family: "DM Sans", sans-serif; */
}

/* ─── Hamburger ─── */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1035;
}

.anim {
  animation: fadeUp 0.4s ease both;
}
.anim-1 {
  animation-delay: 0.05s;
}
.anim-2 {
  animation-delay: 0.1s;
}
.anim-3 {
  animation-delay: 0.15s;
}
.anim-4 {
  animation-delay: 0.2s;
}
.anim-5 {
  animation-delay: 0.25s;
}
.anim-6 {
  animation-delay: 0.3s;
}
.anim-7 {
  animation-delay: 0.35s;
}
.anim-8 {
  animation-delay: 0.4s;
}
.anim-9 {
  animation-delay: 0.45s;
}
.anim-10 {
  animation-delay: 0.5s;
}
.anim-11 {
  animation-delay: 0.55s;
}

/* ============================================================
   INVENTORY OVERVIEW — Responsive CSS
   Covers: section card, header, filters, rows, badges
   Breakpoints: Desktop → Tablet (768px) → Mobile (480px)
   ============================================================ */

/* ── Section Card ── */
.section-card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-top: 24px;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  /* font-family: "Fraunces", serif; */
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
}

/* ── Filter Group ── */
.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  /* font-family: "DM Sans", sans-serif; */
  background: var(--card-bg);
  cursor: pointer;
  color: var(--text-dark);
  min-width: 130px;
  outline: none;
  appearance: auto;
}

.filter-select.green-bg {
  background: var(--green-primary);
  color: #fff;
  border-color: transparent;
}

/* ── Inventory Row ── */
.inv-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.inv-row:last-child {
  border-bottom: none;
}

/* Icon box */
.inv-icon {
  width: 46px;
  height: 46px;
  background: var(--green-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Name */
.inv-name {
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
  color: var(--text-dark);
}

/* Progress bar track */
.inv-bar-wrap {
  flex: 1;
  background: #e8eceb;
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
  min-width: 60px;
}

/* Progress bar fill */
.inv-bar {
  height: 100%;
  border-radius: 50px;
  background: var(--green-primary);
  transition: width 0.6s ease;
}

/* Quantity label */
.inv-qty {
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
  text-align: right;
  white-space: nowrap;
  color: var(--text-dark);
}

/* Badges */
.badge-low {
  background: #fde8e8;
  color: #d63c3c;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 60px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-ok {
  background: #e8f5ed;
  color: var(--green-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 60px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.inv-bar {
  transition: width 0.6s ease;
}

/* ─── Responsive ─── */
/* Mobile: fullscreen modal overlay */

@media (max-width: 575.98px) {
  .cal-footer {
    margin-top: auto;
    padding-top: 16px;
  }
  .cal-btn-cancel,
  .cal-btn-apply {
    flex: 1;
    text-align: center;
    padding: 11px 18px;
  }
}

@media (max-width: 575.98px) {
  .cal-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    overflow-y: auto;
    padding: 16px;
    border: none;
    box-shadow: none;
    display: none;
    flex-direction: column;
  }
  .cal-dropdown.open {
    display: flex;
  }
  .cal-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .cal-mobile-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
  }
  .cal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
  }
}

@media (min-width: 576px) {
  .cal-dropdown.open {
    display: block;
    animation: fadeUp 0.2s ease both;
  }
  .cal-mobile-header {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .cal-panel {
    min-width: 100%;
  }
}

/* Tablet: show one panel, hide second */
@media (min-width: 576px) and (max-width: 767.98px) {
  .cal-dropdown {
    width: 340px;
  }
  .cal-panel:last-child {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .topbar {
    left: 0;
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger {
    display: block;
  }
  .stat-value {
    font-size: 28px;
  }
}

@media (max-width: 575.98px) {
  .page-body {
    padding: 12px;
  }
  .stat-card {
    padding: 13px 12px;
    gap: 10px;
  }
  .stat-value {
    font-size: 20px;
  }
  .stat-unit {
    font-size: 14px;
  }
  .stat-label {
    font-size: 11.5px;
  }
  .arrow-btn {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  .page-title {
    font-size: 20px;
  }
  .page-subtitle {
    font-size: 12px;
  }
  .user-info {
    display: none;
  }
  .date-badge {
    font-size: 12px;
    padding: 7px 11px;
  }
}

/* ─── Animations ─── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .section-card {
    padding: 18px 16px;
    margin-top: 18px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .filter-group {
    width: 100%;
    gap: 8px;
  }

  .filter-select {
    flex: 1;
    min-width: 0; /* allow shrinking below 130px */
    font-size: 12.5px;
    padding: 7px 10px;
  }

  .inv-row {
    gap: 12px;
    padding: 12px 0;
  }

  .inv-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }

  .inv-name {
    font-size: 13px;
    min-width: 60px;
  }

  .inv-bar-wrap {
    height: 8px;
  }

  .inv-qty {
    font-size: 13px;
    min-width: 64px;
  }

  .badge-low,
  .badge-ok {
    font-size: 11px;
    padding: 3px 10px;
    min-width: 50px;
  }
}

@media (max-width: 480px) {
  .section-card {
    padding: 14px 12px;
    border-radius: 12px;
    margin-top: 14px;
  }

  .section-title {
    font-size: 17px;
  }

  .filter-group {
    gap: 6px;
  }

  .filter-select {
    font-size: 12px;
    padding: 6px 8px;
  }

  /* Switch each row to a 2×2 grid */
  .inv-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "icon name  badge"
      "icon bar   qty  ";
    gap: 4px 10px;
    padding: 12px 0;
    align-items: center;
  }

  .inv-icon {
    grid-area: icon;
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 10px;
    align-self: center;
    grid-row: 1 / span 2;
  }

  .inv-name {
    grid-area: name;
    font-size: 13px;
    min-width: unset;
    align-self: end;
  }

  .inv-bar-wrap {
    grid-area: bar;
    height: 7px;
    align-self: start;
    margin-top: 2px;
    min-width: unset;
  }

  .inv-qty {
    grid-area: qty;
    font-size: 12px;
    min-width: unset;
    text-align: right;
    align-self: start;
    margin-top: 2px;
  }

  .badge-low,
  .badge-ok {
    grid-area: badge;
    font-size: 10px;
    padding: 2px 8px;
    min-width: 44px;
    align-self: end;
    justify-self: end;
  }
}

/* =================
====================
==================== */
.page-body {
  animation: fadeUp 0.3s ease both;
}

.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  gap: 16px;
  color: var(--text-muted);
}
.placeholder-page i {
  font-size: 52px;
  opacity: 0.5;
}
.placeholder-page h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
}
.placeholder-page p {
  font-size: 14px;
}
