* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: #f4f4f4;
}
a { text-decoration: none; color: inherit; }

:root { --nav-h: 0px; }

@media (min-width: 901px) {
  .navbar { display: none !important; }
}

/* ── Mobile navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-auto-rows: min-content;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
}
.navbar-title { font-size: 17px; font-weight: 600; color: #1F2937; }
.dash-toggle {
  display: none;
  width: 38px; height: 38px; place-items: center;
  border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; cursor: pointer; flex-shrink: 0;
}
.dash-toggle img { width: 22px; height: 22px; display: block; }

/* Mobile CTA row */
.mobile-cta-bar {
  grid-column: 1 / -1;
  display: none;
}
.mobile-cta-bar .btn-cta {
  width: 100%; padding: 11px 14px; border-radius: 999px;
  border: 1px solid #1F6F79; background: #fff; color: #1F6F79;
  font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer;
}
.mobile-cta-bar .btn-cta:disabled { opacity: .4; border-color: #d1d5db; color: #9ca3af; cursor: not-allowed; }

/* Mobile filter pills */
.filter-pills {
  grid-column: 1 / -1;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px; border-top: 1px solid #e5e7eb;
}
.filter-pills::-webkit-scrollbar { display: none; }

/* ── Layout ── */
.main-layout { display: flex; height: calc(100vh - var(--nav-h)); }

/* ── Sidebar ── */
.sidebar {
  width: 250px; background: #2E2E2E;
  border-top-right-radius: 40px; border-bottom-right-radius: 40px;
  flex-shrink: 0; display: flex; flex-direction: column; z-index: 1100;
}
.side-nav { padding: 24px 16px; color: #fff; display: flex; flex-direction: column; gap: 12px; width: 100%; flex: 1; overflow: auto; }
.side-title { font-size: 18px; font-weight: 600; opacity: .9; margin-bottom: 6px; }
.side-menu { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.side-menu a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; width: 100%; border-radius: 14px; color: rgba(255,255,255,.9); font-weight: 500; transition: background .2s ease; }
.side-menu a:hover { background: #3a3a3a; }
.side-menu a.active { background: #1F6F79; color: #fff; box-shadow: 0 6px 18px rgba(31,111,121,.35); }
.side-menu a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; transition: background .2s ease; flex-shrink: 0; }
.side-menu a.active::before { background: #fff; }
.side-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.logout-btn { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid #ef4444; background: transparent; color: #ef4444; font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.logout-btn:hover { background: #ef4444; color: #fff; }
.sidebar-overlay { display: none; }

/* ── Content ── */
.content { flex: 1; overflow-y: auto; padding: 28px 32px; }

/* ── Desktop toolbar: filter pills + CTA ── */
.desktop-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.navbar-center2 { display: flex; }
.navbarul2 { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.navbarli2 { list-style: none; }
.navbarli2 a {
  display: block; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  border: 1px solid #dde3ea; background: #fff; color: #374151;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.navbarli2 a:hover,
.navbarli2.selected a {
  background: #1F6F79; color: #fff; border-color: #1F6F79;
  box-shadow: 0 4px 12px rgba(31,111,121,.18);
}
.desktop-ctas { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }

/* CTA buttons */
.btn-cta {
  display: none;
  padding: 9px 18px; border-radius: 12px;
  border: 1px solid #1F6F79; background: #fff; color: #1F6F79;
  font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer;
  white-space: nowrap; transition: background .15s, color .15s;
}
.btn-cta:hover { background: #1F6F79; color: #fff; }
.btn-cta.show { display: inline-block; }

/* ── Packages container ── */
.packages-box { display: flex; flex-direction: column; gap: 16px; }
.packages-header { display: none; }

/* ── Section divider ── */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  color: #9ca3af; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
}
.section-divider::before,
.section-divider::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }

/* ── Bundle group card (matches myconsolidation style) ── */
.bundle-group-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  overflow: hidden;
}
.card-top {
  background: #2E2E2E;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.card-top-info { display: flex; flex-direction: column; gap: 3px; }
.card-code { font-size: 16px; font-weight: 700; color: #fff; }
.card-date { font-size: 12px; color: #999; }
.view-req-btn {
  background: #1F6F79; color: #fff;
  border: none; border-radius: 12px;
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .2s;
}
.view-req-btn:hover { background: #17565e; }

.card-body {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid #f0f0f0;
}
.card-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 20px; border-right: 1px solid #f0f0f0; }
.card-stat:last-child { border-right: none; }
.stat-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 15px; font-weight: 600; color: #1a1a1a; }

/* Status colours */
.status-draft     { color: #6b7280; }
.status-pending   { color: #d97706; }
.status-submitted { color: #2563eb; }
.status-approved  { color: #059669; }
.status-rejected  { color: #dc2626; }
.status-shipped   { color: #7c3aed; }
.status-delivered { color: #0284c7; }

/* ── Package rows inside bundle card ── */
.bundle-pkg-list { border-top: 1px solid #f0f0f0; }
.bundle-pkg-row {
  padding: 12px 20px;
  border-bottom: 1px solid #f8f8f8;
  font-size: 13px;
}
.bundle-pkg-row:last-child { border-bottom: none; }
.bundle-pkg-main {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.bundle-pkg-main .pkg-tracking-num { flex: 1; min-width: 140px; font-size: 13px; font-weight: 600; color: #1b3a40; }
.bundle-pkg-main .pkg-arrival { font-size: 12px; color: #6b7280; }
.bundle-pkg-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.bundle-pkg-row .package-details {
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .35s ease, opacity .25s ease;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 20px; font-size: 12px;
  background: #f8fafc; padding: 0 0;
  border-top: 0 solid #f0f0f0;
}
.bundle-pkg-row .package-details strong { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: #9ca3af; display: block; }
.bundle-pkg-row.open .package-details {
  max-height: 400px; opacity: 1;
  padding: 12px 0; margin-top: 8px; border-top-width: 1px;
}

/* ── Standalone (unbundled) package card — same visual style as bundle-group-card ── */
.package-row {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  overflow: hidden;
}

/* Buttons inside the dark card-top for unbundled cards */
.card-top-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Ghost button — transparent with white border, sits on dark header */
.pkg-ghost-btn {
  background: transparent; color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.3); border-radius: 10px;
  padding: 7px 13px; font-size: 12px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.pkg-ghost-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.pkg-ghost-btn.active { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.6); }

/* Shared button style for bundle package rows */
.package-btn {
  padding: 7px 14px; border-radius: 10px;
  border: 1px solid #e5e7eb; background: #fff;
  font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.package-btn:hover { background: #f9fafb; }
.package-btn.view-details { color: #374151; }
.package-btn.view-details.active { background: #1F6F79; color: #fff; border-color: #1F6F79; }
.package-btn.danger-btn { color: #dc2626; border-color: #fca5a5; }
.package-btn.danger-btn:hover { background: #fef2f2; }

/* ── Empty states ── */
.empty-state { text-align: center; padding: 48px 20px; color: #9ca3af; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.empty-state p  { margin-bottom: 16px; }
.primary-btn { display: inline-block; padding: 10px 20px; border-radius: 10px; background: #1F6F79; color: #fff; font-weight: 600; font-size: 14px; }

/* ── Mobile (≤900px) ── */
@media (max-width: 900px) {
  :root { --nav-h: auto; }
  .dash-toggle { display: inline-grid; }
  .main-layout { display: block; height: auto; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1100;
    width: min(84vw, 300px); height: 100vh;
    border-radius: 0 20px 20px 0;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.15);
  }
  .sidebar.open, .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 1090;
    display: none; background: rgba(0,0,0,.4); backdrop-filter: blur(2px);
  }
  .sidebar-overlay.show { display: block; }

  .content { padding: 14px 12px 80px; }
  .desktop-toolbar { display: none; }

  .mobile-cta-bar { display: grid; }

  /* Filter pills inside navbar */
  .filter-pills .navbarul2 {
    display: flex; gap: 8px; padding: 0 2px; margin: 0;
    list-style: none; white-space: nowrap;
  }
  .filter-pills .navbarli2 { list-style: none; flex: 0 0 auto; }
  .filter-pills .navbarli2 a {
    display: block; padding: 7px 13px; border-radius: 999px;
    font-size: 13px; font-weight: 500; line-height: 1;
    background: #f3f4f6; color: #111827; border: 1px solid #e5e7eb;
  }
  .filter-pills .navbarli2.selected a {
    background: #1F6F79; color: #fff; border-color: #1F6F79;
    box-shadow: 0 4px 12px rgba(31,111,121,.15); font-weight: 600;
  }

  /* Tighten card sizes */
  .card-top { padding: 14px 16px; }
  .card-code { font-size: 15px; }
  .card-stat { padding: 12px 14px; }
  .stat-value { font-size: 14px; }
  .bundle-pkg-row { padding: 10px 16px; }

  @media (max-width: 400px) {
    .card-body { grid-template-columns: 1fr; }
    .card-stat { border-right: none; border-bottom: 1px solid #f0f0f0; }
    .card-stat:last-child { border-bottom: none; }
  }
}

@media (min-width: 901px) {
  .mobile-cta-bar { display: none !important; }
}
