/**
 * Celbert Grocery Ordering System
 * Administrator Dashboard Stylesheet
 * Handcrafted Pure CSS with Bootstrap 5 integration (No Tailwind)
 */

:root {
  --admin-sidebar-width: 272px;
  --admin-topbar-height: 72px;
  --admin-primary: #e10600;
  --admin-primary-dark: #c40000;
  --admin-dark: #1a1d26;
  --admin-bg: #f4f6fb;
  --admin-border: #e9ecef;
}

body.admin-layout {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--admin-dark);
  min-height: 100vh;
  background-color: #f4f6fb;
  overflow-x: hidden;
}

.admin-layout > .d-flex {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Sidebar */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--admin-sidebar-width);
  z-index: 1030;
  padding: 0;
  background: #fff;
  border-right: 1px solid #eef1f6;
  color: #1a1d26;
  overflow: hidden;
  box-shadow: 8px 0 30px rgba(26, 29, 38, 0.03);
}

.cg-brand {
  display: flex;
  align-items: center;
  padding: 18px 20px 12px;
  text-decoration: none;
  color: inherit;
}

.cg-brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.admin-sidebar .sidebar-menu {
  padding: 6px 0 8px;
}

.admin-sidebar .sidebar-link,
.admin-sidebar .nav-link {
  min-height: 46px;
  color: #3c4353;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 14px;
  margin: 3px 14px;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar .sidebar-link:hover,
.admin-sidebar .nav-link:hover {
  color: #e10600;
  background: #fff4f4;
}

.admin-sidebar .sidebar-link.active,
.admin-sidebar .nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, #e10600 0%, #ff2a2a 100%);
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(225, 6, 0, 0.22);
}

.admin-sidebar .sidebar-link i,
.admin-sidebar .nav-link i {
  flex: 0 0 18px;
  color: #5d6678;
  font-size: 1.12rem;
  text-align: center;
}

.admin-sidebar .nav-link.active i,
.admin-sidebar .nav-link:hover i {
  color: inherit;
}

.admin-sidebar .nav-link > span:first-of-type {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
}

.admin-sidebar .sidebar-link {
  text-decoration: none;
}

.sidebar-count {
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff1f1;
  color: #e10600;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.sidebar-count-alert {
  background: #e10600;
  color: #fff;
}

.admin-sidebar .nav-link.active .sidebar-count-alert {
  background: #fff;
  color: #e10600;
}

.admin-sidebar-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-height: 210px;
  margin-top: auto;
  padding: 8px 14px 18px;
  overflow: hidden;
  border-top: 0;
}

.cg-side-user {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 8px 8px 4px;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border-radius: 16px;
}

.cg-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff4545, #d10000);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 6px 14px rgba(225, 6, 0, 0.25);
}

.cg-side-user-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.cg-side-user-copy strong {
  overflow: hidden;
  color: #1a1d26;
  font-size: 0.86rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cg-side-user-copy span {
  color: #8b93a7;
  font-size: 0.75rem;
  font-weight: 600;
}

.cg-side-user .bi-chevron-down {
  color: #9aa3b5;
  font-size: 0.8rem;
}

.cg-wave-link {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.cg-wave-link:hover {
  color: #fff;
  opacity: 0.88;
}

.cg-side-wave {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 156px;
  pointer-events: none;
}

.admin-header-bell {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff4f4;
  color: #c62828;
  font-size: 1.15rem;
  line-height: 1;
}

.admin-header-bell[hidden] {
  display: none !important;
}

.admin-header-bell:hover,
.admin-header-bell:focus-visible {
  background: #ffe4e4;
  color: #a91f24;
}

.admin-header-bell .notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  font-size: 0.62rem;
  line-height: 14px;
}

/* Main Content Area */
.admin-main-wrapper {
  margin-left: var(--admin-sidebar-width);
  width: calc(100% - var(--admin-sidebar-width));
  max-width: calc(100% - var(--admin-sidebar-width));
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navigation Bar */
.admin-topbar {
  height: auto;
  min-height: var(--admin-topbar-height);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 10px;
  padding-bottom: 10px;
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  padding-right: 80px !important;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.025);
}

.admin-menu-toggle,
.admin-sidebar-backdrop {
  display: none;
}

.reports-topbar {
  height: auto;
  min-height: var(--admin-topbar-height);
  gap: 12px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.reports-filter,
.reports-exports {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reports-filter .form-control {
  width: 9.75rem;
  flex: 0 0 auto;
}

.reports-filter .btn,
.reports-exports .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-content-body {
  padding: 26px 30px;
  flex-grow: 1;
  min-width: 0;
  max-width: 100%;
}

/* Metric / KPI Cards */
.stat-kpi-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 19px;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.025);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.stat-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.07);
  border-color: #f0c7c8;
}

a.stat-kpi-card,
a.stat-kpi-trigger {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

a.stat-kpi-card:hover,
a.stat-kpi-card:focus,
a.stat-kpi-trigger:hover,
a.stat-kpi-trigger:focus {
  color: inherit;
  text-decoration: none;
}

a.stat-kpi-card:focus-visible,
a.stat-kpi-trigger:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.dashboard-kpi-modal .modal-content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
}

.dashboard-kpi-modal .modal-header,
.dashboard-kpi-modal .modal-footer {
  padding: 16px 20px;
}

.dashboard-kpi-modal .modal-title {
  color: #1f2937;
}

.kpi-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.bubble-red {
  background: #fff0f0;
  color: #c62828;
}

.bubble-green {
  background: #fff4f4;
  color: #bd3034;
}

.bubble-blue {
  background: #fff7f7;
  color: #a91f24;
}

.bubble-amber {
  background: #fff1f1;
  color: #d14347;
}

.bubble-purple {
  background: #fff5f5;
  color: #8f2529;
}

/* Tables */
.admin-table-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.025);
}

.admin-table-card > .bg-light {
  background-color: #fff !important;
  border-color: var(--admin-border) !important;
}

.admin-table th {
  background-color: #fff7f7;
  color: #606978;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f0dada;
  padding: 13px 16px;
}

.admin-table td {
  padding: 13px 16px;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f2f4;
}

.admin-table tbody tr:hover {
  background-color: #fffafa;
}

.customer-address-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--admin-border, #e7e8ea);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
}

.customer-address-line-text {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
}

.customer-address-line-text strong,
.customer-address-line-text .badge {
  flex-shrink: 0;
}

.customer-address-line-text .text-muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-layout .table tbody tr.needs-action > * {
  --bs-table-bg: #fff4e0;
  --bs-table-accent-bg: #fff4e0;
  background-color: #fff4e0;
}

.admin-layout .table tbody tr.needs-action:hover > * {
  --bs-table-bg: #ffe4c2;
  --bs-table-accent-bg: #ffe4c2;
  background-color: #ffe4c2;
}

.admin-layout .table tbody tr.needs-action > *:first-child {
  border-left: 4px solid #e8890c;
}

.admin-table-card.needs-action-card,
.list-group-item.needs-action {
  background: #fff4e0;
  border-color: #f5c07a;
  box-shadow: inset 4px 0 0 #e8890c, 0 2px 8px rgba(31, 41, 55, 0.025);
}

/* Compact order and payment queue */
.orders-live-card {
  border-radius: 12px;
  max-width: 100%;
}

.orders-live-card .table-responsive {
  max-width: 100%;
}

.orders-live-heading {
  min-height: 48px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
}

.orders-live-heading small {
  color: #718096;
  font-size: 0.68rem;
  font-weight: 400;
}

.orders-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 0 16px 12px;
}

.orders-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.orders-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  width: min(100%, 280px);
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d5deea;
  border-radius: 999px;
  background: #fff;
  color: #94a3b8;
}

.orders-search:focus-within {
  border-color: #e8b4b4;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.08);
}

.orders-search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f2937;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 0;
}

.orders-search input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.orders-filter-chip {
  border: 1px solid #d5deea;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.orders-filter-chip span {
  display: inline-block;
  margin-left: 6px;
  min-width: 1.25rem;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.68rem;
  text-align: center;
}

.orders-filter-chip:hover {
  border-color: #e8b4b4;
  color: var(--admin-primary);
}

.orders-filter-chip.is-active {
  background: var(--admin-primary);
  border-color: var(--admin-primary);
  color: #fff;
}

.orders-filter-chip.is-active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.orders-live-table {
  width: 100%;
  table-layout: fixed;
}

.orders-live-table th:nth-child(1) { width: 16%; }
.orders-live-table th:nth-child(2) { width: 16%; }
.orders-live-table th:nth-child(3) { width: 20%; }
.orders-live-table th:nth-child(4) { width: 16%; }
.orders-live-table th:nth-child(5) { width: 16%; }
.orders-live-table th:nth-child(6) { width: 16%; }

.orders-live-table thead th {
  background: #f8fafc;
  border-bottom-color: #dce3eb;
  color: #53657d;
  font-size: 0.68rem;
  letter-spacing: 0;
  padding: 11px 8px;
  white-space: normal;
}

.orders-live-table tbody td {
  padding: 12px 8px;
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.orders-live-table tbody tr:hover {
  background: #fbfdff;
}

.orders-live-number {
  color: #c62828;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.orders-live-number:hover {
  text-decoration: underline;
}

.orders-destination-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.orders-destination-button .bi-geo-alt-fill {
  color: #c62828;
}

.orders-destination-button:hover .orders-destination-label,
.orders-destination-button:focus-visible .orders-destination-label {
  color: #c62828;
  text-decoration: underline;
}

.orders-destination-button:focus-visible {
  outline: 2px solid #c62828;
  outline-offset: 2px;
  border-radius: 4px;
}

.destination-map-modal .modal-body {
  padding-top: 0.75rem;
}

.destination-map-address {
  font-weight: 700;
  color: #1e293b;
}

.destination-map-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #e8eef4;
}

.destination-map-canvas {
  height: 360px;
  width: 100%;
  background: #dbe7ee;
}

.destination-map-canvas.leaflet-container {
  font-family: inherit;
  background: #dbe7ee;
}

.leaflet-marker-icon.destination-map-marker {
  background: none;
  border: 0;
}

.destination-map-pin {
  position: relative;
  width: 46px;
  height: 58px;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.32));
}

.destination-map-pin svg {
  display: block;
  width: 46px;
  height: 58px;
}

.destination-map-pin-tip {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(28, 28, 28, 0.28);
  transform: translate(-50%, 50%);
}

.destination-map-status {
  margin: 0;
  padding: 8px 12px;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.destination-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
  gap: 12px;
  align-items: stretch;
}

.destination-map-layout.is-map-only {
  grid-template-columns: minmax(0, 1fr);
}

.destination-route {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
}

.destination-route-kicker {
  margin: 0 0 2px;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.destination-route-distance {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.destination-route-fee {
  margin: 4px 0 0;
  font-weight: 700;
  color: #b42318;
}

.destination-route-meta {
  margin: 4px 0 12px;
  color: #64748b;
  font-size: 0.8rem;
}

.destination-route-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 8px;
}

.destination-route-steps li {
  color: #1e293b;
  font-size: 0.86rem;
}

.destination-route-steps small {
  display: block;
  color: #64748b;
}

.store-location-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.store-location-toolbar .form-control {
  flex: 1 1 220px;
}

.store-location-results {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.store-location-result {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
}

.store-location-result:hover,
.store-location-result:focus-visible {
  border-color: #15803d;
  background: #f0fdf4;
}

.store-location-map {
  height: 360px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #dbe7ee;
}

.store-location-map.leaflet-container {
  font-family: inherit;
  background: #dbe7ee;
}

@media (max-width: 767px) {
  .destination-map-layout,
  .destination-map-layout.is-map-only {
    grid-template-columns: minmax(0, 1fr);
  }

  .destination-route {
    max-height: 260px;
  }
}

.orders-view-button {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.orders-view-button:hover {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.orders-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.orders-items-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f6;
}

.orders-items-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.orders-items-list .catalog-photo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  object-fit: cover;
}

.orders-items-name {
  min-width: 0;
  font-weight: 600;
  color: #1f2937;
}

.orders-items-qty {
  margin-left: auto;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.orders-items-price {
  min-width: 5.5rem;
  font-weight: 700;
  color: #1f2937;
  text-align: right;
  white-space: nowrap;
}

.orders-items-summary {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.orders-items-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 0.9rem;
}

.orders-items-summary .orders-items-grand {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #eef2f6;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 700;
}

.orders-items-summary .orders-items-grand span:last-child {
  color: #b42318;
}

.payment-proof-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b42318;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.payment-proof-link:hover {
  text-decoration: underline;
}

.payment-proof-thumb {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.payment-proof-modal .modal-body {
  display: flex;
  justify-content: center;
  background: #fff;
}

.payment-proof-full {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(75vh, 820px);
  object-fit: contain;
  border-radius: 8px;
}

.orders-live-total {
  white-space: nowrap;
}

.payment-state {
  display: inline-block;
  max-width: 100%;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: lowercase;
  vertical-align: 1px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.payment-state-verified {
  background: #d1fae5;
  color: #047857;
}

.payment-state-pending {
  background: #fef3c7;
  color: #a16207;
}

.payment-state-failed,
.payment-state-refunded {
  background: #fee2e2;
  color: #b91c1c;
}

.orders-status-form {
  min-width: 0;
  width: 100%;
}

.orders-status-select {
  width: 100%;
  min-height: 31px;
  padding: 4px 20px 4px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
}

.orders-status-select.status-pending {
  border-color: #fbbf24;
  background-color: #fffbeb;
  color: #92400e;
}

.orders-status-select.status-confirmed,
.orders-status-select.status-preparing {
  border-color: #f59e0b;
  background-color: #fff7ed;
  color: #9a3412;
}

.orders-status-select.status-ready-for-pickup,
.orders-status-select.status-out-for-delivery {
  border-color: #60a5fa;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.orders-status-select.status-completed {
  border-color: #34d399;
  background-color: #ecfdf5;
  color: #047857;
}

.orders-status-select.status-cancelled,
.orders-status-select.status-rejected {
  border-color: #fca5a5;
  background-color: #fef2f2;
  color: #b91c1c;
}

.orders-reject-note {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.orders-reject-label {
  margin: 0 0 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b91c1c;
}

.orders-reject-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.orders-reject-chips button {
  border: 1px solid #fecaca;
  background: #fff;
  color: #991b1b;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
}

.orders-reject-chips button.is-active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.orders-reject-error {
  margin: 4px 0 0;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 600;
}

.orders-reject-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.orders-reject-actions .btn {
  font-size: 0.68rem;
  font-weight: 700;
}

.orders-reject-back {
  color: #64748b;
  text-decoration: none;
  padding-inline: 6px;
}

.orders-status-reason {
  display: block;
  margin-top: 4px;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
}

.orders-live-actions {
  min-width: 0;
  text-align: right;
  white-space: normal;
}

.orders-action-button {
  margin: 2px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.orders-driver-button {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.orders-driver-button:hover {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1e40af;
}

.orders-driver-button:disabled,
.orders-driver-button:disabled:hover {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.orders-driver-lock {
  display: block;
  margin: 2px 2px 0;
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
}

.driver-roster-details {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
}

.orders-driver-note {
  display: block;
  margin: 2px 2px 0;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
}

.assign-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.assign-finding-fields {
  display: grid;
  gap: 1rem;
}

[data-assign-panel][hidden],
[data-partner-other][hidden] {
  display: none !important;
}

.assign-mode-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.assign-mode-option input {
  margin-top: 3px;
}

.assign-mode-option:has(input:checked) {
  border-color: #c62828;
  background: #fff5f5;
}

.assign-mode-option strong,
.assign-found-option strong {
  display: block;
  font-size: 0.92rem;
}

.assign-mode-option small,
.assign-found-option small {
  display: block;
  color: #64748b;
  line-height: 1.35;
}

.assign-found-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff7f7;
  cursor: pointer;
}

.assign-found-option input {
  margin-top: 3px;
}

@media (max-width: 520px) {
  .assign-mode {
    grid-template-columns: 1fr;
  }
}

.orders-verify-button {
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #047857;
}

.orders-verify-button:hover {
  border-color: #a7f3d0;
  background: #d1fae5;
  color: #065f46;
}

.orders-delivered-button {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.orders-delivered-button:hover {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.orders-print-button,
.orders-more-toggle {
  width: 28px;
  height: 28px;
  margin: 2px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.orders-print-button:hover,
.orders-more-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.orders-more-actions {
  position: relative;
  display: inline-block;
}

.orders-more-toggle {
  cursor: pointer;
  list-style: none;
}

.orders-more-toggle::-webkit-details-marker {
  display: none;
}

.orders-more-panel {
  position: static;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.14);
  text-align: left;
  white-space: normal;
}

.orders-more-panel form + form {
  padding-top: 8px;
  border-top: 1px solid var(--admin-border);
}

/* Status Badges */
.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  display: inline-block;
  text-transform: capitalize;
}

/* Filter Card */
.filter-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.025);
}

.admin-layout .form-control:focus,
.admin-layout .form-select:focus {
  border-color: #df8b8e;
  box-shadow: 0 0 0 0.2rem rgba(198, 40, 40, 0.12);
}

.admin-layout .btn-danger {
  background-color: var(--admin-primary);
  border-color: var(--admin-primary);
}

.admin-layout .btn-danger:hover {
  background-color: var(--admin-primary-dark);
  border-color: var(--admin-primary-dark);
}

/* Responsive adjustment for Mobile screens */
@media (max-width: 991.98px) {
  .admin-menu-toggle {
    display: inline-flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1040;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 1.35rem;
    line-height: 1;
  }

  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1025;
    background: rgba(15, 27, 50, 0.45);
  }

  .admin-sidebar-backdrop:not([hidden]) {
    display: block;
  }

  .admin-sidebar {
    z-index: 1035;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .admin-sidebar.show {
    transform: translateX(0);
  }

  .admin-main-wrapper {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .admin-topbar {
    padding-left: 64px !important;
  }

  .admin-content-body {
    padding: 20px;
  }
}

@media (max-width: 575.98px) {
  .admin-content-body {
    padding: 16px 12px;
  }

  .admin-topbar {
    padding-left: 62px !important;
    padding-right: 64px !important;
  }

  .admin-topbar h5 {
    font-size: 1rem;
  }

  .stat-kpi-card {
    padding: 16px;
  }

  .filter-card {
    padding: 16px;
  }
}

/* Product catalogue */
.products-main {
  min-width: 0;
}

.products-page {
  min-width: 0;
  padding: 28px 30px 36px;
}

.products-page .admin-topbar .badge {
  padding: 7px 12px;
  background: #fff0f0 !important;
  color: var(--admin-primary) !important;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-preview-card {
  position: sticky;
  top: calc(var(--admin-topbar-height) + 20px);
}

.admin-layout .product-form-modal.modal-dialog {
  max-width: min(1080px, calc(100vw - 2rem));
}

.product-form-modal .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.18);
}

.product-form-modal .modal-header,
.product-form-modal .modal-footer {
  padding: 16px 20px;
  border-color: #f1f3f5;
}

.product-form-modal .modal-title {
  color: #1f2937;
}

.product-form-modal .modal-body {
  padding: 18px 20px;
}

.product-form-modal .product-preview-card {
  position: static;
}

.product-preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 240px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.product-preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.product-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.78rem;
}

.product-preview-placeholder i {
  font-size: 2rem;
}

.catalogue-card {
  border-color: #e7ebf0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.025);
}

.catalogue-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 14px;
  background: #fff;
}

.catalogue-description {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 500;
}

.catalogue-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.catalogue-card-actions .btn {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 650;
  box-shadow: 0 3px 8px rgba(198, 40, 40, 0.12);
}

.catalogue-card .table-responsive {
  scrollbar-color: #cbd2dc #f5f6f8;
  scrollbar-width: thin;
}

.catalogue-table {
  min-width: 1140px;
  table-layout: fixed;
}

.catalogue-table th,
.catalogue-table td {
  padding-right: 12px;
  padding-left: 12px;
}

.catalogue-table th {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f8fafc;
  color: #526174;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.catalogue-table th:nth-child(1) { width: 19%; }
.catalogue-table th:nth-child(2) { width: 12%; }
.catalogue-table th:nth-child(3) { width: 7%; }
.catalogue-table th:nth-child(4) { width: 10%; }
.catalogue-table th:nth-child(5) { width: 9%; }
.catalogue-table th:nth-child(6) { width: 12%; }
.catalogue-table th:nth-child(7) { width: 14%; }
.catalogue-table th:nth-child(8) { width: 17%; }

.catalogue-table td {
  padding-top: 9px;
  padding-bottom: 9px;
  color: #293548;
  font-size: 0.75rem;
  line-height: 1.4;
}

.catalogue-table td,
.catalogue-table th {
  border-color: #edf1f5;
}

.catalogue-table tbody tr:last-child td {
  border-bottom: 0;
}

.catalogue-table tbody tr:hover {
  background: #f8fafc;
}

.catalogue-table tbody tr.low-stock-row > * {
  --bs-table-bg: #fff1f2;
  --bs-table-accent-bg: #fff1f2;
  --bs-table-hover-bg: #ffe4e6;
  background-color: #fff1f2;
}

.catalogue-table tbody tr.low-stock-row:hover > * {
  --bs-table-bg: #ffe4e6;
  --bs-table-accent-bg: #ffe4e6;
  background-color: #ffe4e6;
}

.catalogue-table tbody tr.low-stock-row > *:first-child {
  box-shadow: inset 3px 0 0 #e11d48;
}

.catalogue-table td small {
  margin-top: 3px;
  color: #8993a2 !important;
  font-size: 0.64rem;
  line-height: 1.45;
}

.product-identity strong {
  display: block;
  color: #202b3c;
  font-size: 0.76rem;
  font-weight: 700;
}

.product-image {
  display: block;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e8edf2;
}

.product-image-placeholder {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.9rem;
}

.product-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  color: #8993a2;
  font-size: 0.62rem;
}

.product-meta .badge {
  padding: 2px 5px;
  border-radius: 4px;
  color: #657184 !important;
  font-size: 0.55rem;
  font-weight: 650;
  text-transform: capitalize;
}

.product-prices strong {
  color: #202b3c;
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
}

.product-retail-price strong {
  color: #c62828;
  font-weight: 800;
}

.product-stock .badge {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.product-stock .stock-pill-ok {
  background: #d1fae5;
  color: #047857;
}

.product-stock .stock-pill-low {
  background: #fee2e2;
  color: #b91c1c;
}

.product-supplier {
  overflow: hidden;
  color: #526174 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-actions {
  white-space: nowrap;
}

.product-actions form {
  margin: 0;
}

.product-icon-button {
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-icon-button:hover {
  transform: translateY(-1px);
}

.product-icon-button:active {
  transform: translateY(0) scale(0.96);
}

.product-icon-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.product-stock-button {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #2563eb;
}

.product-stock-button:hover {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}

.product-restock-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.product-restock-button:hover {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.12);
  transform: translateY(-1px);
}

.product-restock-button:active {
  transform: translateY(0) scale(0.96);
}

.product-restock-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.2);
}

.product-edit-button {
  border-color: #e0e7ff;
  background: #eef2ff;
  color: #4f46e5;
}

.product-edit-button:hover {
  border-color: #c7d2fe;
  background: #e0e7ff;
  color: #4338ca;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.12);
}

.product-discontinue-button {
  border-color: #fee2e2;
  background: #fef2f2;
  color: #b91c1c;
}

.product-discontinue-button:hover {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.12);
}

.stock-modal-form + .stock-modal-form {
  padding-top: 18px;
  border-top: 1px solid #e9ecef;
}

.restock-price-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.restock-price-card div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  background: #fff1f2;
}

.restock-price-card span {
  display: block;
  margin-bottom: 3px;
  color: #9f1239;
  font-size: 0.68rem;
  font-weight: 650;
}

.restock-price-card strong {
  color: #1f2937;
  font-size: 0.92rem;
}

.restock-next-note {
  color: #be123c;
  font-weight: 650;
}

@media (max-width: 575.98px) {
  .restock-price-card {
    grid-template-columns: 1fr;
  }
}

.delivery-form-modal .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.18);
}

.delivery-form-modal .modal-header,
.delivery-form-modal .modal-footer {
  padding: 16px 20px;
  border-color: #f1f3f5;
}

.delivery-form-modal .modal-title {
  color: #1f2937;
}

.delivery-form-modal .modal-body {
  padding: 18px 20px;
}


.recipe-form-modal .modal-dialog {
  max-width: min(1040px, calc(100vw - 2rem));
}

.recipe-form-modal .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.18);
}

.recipe-form-modal .modal-header,
.recipe-form-modal .modal-footer {
  padding: 16px 20px;
  border-color: #f1f3f5;
}

.recipe-form-modal .modal-title {
  color: #1f2937;
}

.recipe-form-modal .modal-body {
  padding: 18px 20px;
}

.recipe-picture-preview,
.recipe-admin-thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.recipe-picture-preview {
  margin-top: 0.5rem;
}

.recipe-admin-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex: 0 0 56px;
}

.recipe-form-modal .recipe-admin-ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) 92px 46px;
  gap: 0.5rem;
  align-items: end;
}

.recipe-form-modal .recipe-admin-ingredient-row > [class*="col-"] {
  width: auto;
  max-width: none;
  padding: 0;
}

@media (max-width: 575.98px) {
  .recipe-form-modal .recipe-admin-ingredient-row {
    grid-template-columns: 1fr 1fr;
  }

  .recipe-form-modal .recipe-admin-ingredient-row > :first-child,
  .recipe-form-modal .recipe-admin-ingredient-row > :nth-child(2) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .products-page {
    padding: 20px 16px 28px;
  }

  .catalogue-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .catalogue-card-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .catalogue-card-actions .btn {
    width: 100%;
  }

  .catalogue-table {
    min-width: 0;
  }
}

/* Keep every admin page inside the viewport when the window is resized. */
.admin-topbar form.d-flex {
  flex: 1 1 16rem;
  min-width: 0;
}

.admin-topbar form.d-flex .form-control {
  flex: 1 1 8rem;
  width: auto;
  min-width: 0;
}

.admin-topbar h5 {
  overflow-wrap: anywhere;
}

.admin-topbar .d-flex,
.admin-content-body .d-flex,
.admin-table-card .d-flex,
.orders-live-heading,
.filter-card form {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.admin-content-body .row,
.admin-content-body .row > [class*="col"] {
  min-width: 0;
  max-width: 100%;
}

.admin-content-body,
.filter-card,
.stat-kpi-card,
.tab-content,
.tab-pane {
  min-width: 0;
  max-width: 100%;
}

.stat-kpi-card h3,
.stat-kpi-card span,
.admin-content-body p,
.admin-content-body li,
.admin-content-body td,
.admin-content-body th {
  overflow-wrap: break-word;
}

.admin-content-body .table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.admin-table-card:not(:has(.table-responsive)) {
  overflow-x: auto;
}

.admin-table:not(.catalogue-table):not(.orders-live-table):not(.inventory-editor-table):not(.inventory-line-table):not(.click-line-table) {
  width: max-content;
  min-width: 100%;
}

.click-line-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.click-line-table td {
  padding: 0;
}

.line-open {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.line-open:hover,
.line-open:focus-visible {
  color: inherit;
  background: transparent;
}

.line-open:focus-visible {
  outline: 2px solid var(--admin-primary, #dc3545);
  outline-offset: -2px;
}

.line-open .inventory-line {
  width: 100%;
}

.line-open-chevron {
  flex: 0 0 auto;
  color: #b0b7c3;
  font-size: 0.85rem;
}

.inventory-line-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.inventory-line-table th:last-child,
.inventory-line-table td:last-child {
  width: 72px;
  white-space: nowrap;
  vertical-align: middle;
}

.inventory-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.inventory-line strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #202b3c;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-line-meta {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #8993a2;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-line .badge {
  flex: 0 0 auto;
  font-weight: 650;
}

.inventory-editor-table {
  width: 100%;
  min-width: 720px;
  table-layout: auto;
}

.inventory-editor-table .form-control,
.inventory-editor-table .form-select {
  width: 100%;
}

.inventory-editor-table th:last-child,
.inventory-editor-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.admin-content-body .nav-tabs {
  flex-wrap: wrap;
  row-gap: 4px;
}

.admin-section-tabs .nav-link {
  color: #5c6778;
  font-weight: 600;
}

.admin-section-tabs .nav-link:hover,
.admin-section-tabs .nav-link.active {
  color: var(--admin-primary);
}

.admin-content-body .nav-tabs .nav-link {
  white-space: normal;
}

.admin-content-body img:not(.product-image):not(.catalog-photo):not(.payment-proof-thumb),
.admin-content-body canvas,
.admin-content-body svg {
  max-width: 100%;
}

.admin-content-body pre,
.admin-content-body code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.admin-content-body details form,
.admin-content-body form[style*="min-width"] {
  min-width: 0 !important;
  width: min(100%, 420px);
  max-width: 100%;
}

.admin-content-body input,
.admin-content-body select,
.admin-content-body textarea,
.admin-content-body .form-control,
.admin-content-body .form-select {
  max-width: 100%;
  min-width: 0;
}

.filter-card form.d-flex > .form-control {
  flex: 1 1 12rem;
}

.line-product {
  min-width: 0;
  max-width: 100%;
}

.line-product > span,
.line-product > div {
  min-width: 0;
}

.orders-more-panel {
  width: min(245px, 100%);
  max-width: 100%;
}

.admin-layout .modal-dialog {
  max-width: min(var(--bs-modal-width, 500px), calc(100vw - 1.5rem));
  margin-left: auto;
  margin-right: auto;
}

.admin-layout .modal-body,
.stock-modal-form .d-flex > * {
  min-width: 0;
}

@media (max-width: 1199.98px) {
  .orders-live-table,
  .catalogue-table {
    min-width: 0;
    width: 100%;
  }

  .catalogue-table {
    table-layout: auto;
  }

  .orders-live-actions,
  .orders-status-form {
    min-width: 0;
  }

  .orders-live-actions,
  .orders-live-table thead th,
  .product-actions {
    white-space: normal;
  }

  .reports-toolbar,
  .reports-filter,
  .reports-exports {
    width: 100%;
    justify-content: flex-start;
  }

  .reports-filter .form-control {
    flex: 1 1 8.5rem;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  .orders-search {
    margin-left: 0;
    width: 100%;
  }

  .orders-live-table {
    min-width: 760px;
  }

  .catalogue-table {
    min-width: 860px;
    table-layout: fixed;
  }
}

@media (max-width: 575.98px) {
  .stat-kpi-card h3 {
    font-size: 1.25rem;
  }

  .admin-table th,
  .admin-table td {
    padding-right: 10px;
    padding-left: 10px;
  }

  .orders-live-heading,
  .admin-table-card > .border-bottom,
  .admin-table-card > .p-3.d-flex {
    align-items: flex-start;
  }
}

@media (max-width: 767.98px) {
  .admin-topbar {
    align-items: flex-start;
  }

  .admin-topbar .btn,
  .admin-content-body .btn,
  .filter-card .btn {
    min-height: 40px;
  }

  .products-page,
  .admin-content-body {
    padding: 16px 12px 28px;
  }

  .filter-card .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .line-product img,
  .catalog-photo,
  .recipe-admin-thumb,
  .recipe-picture-preview {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    object-fit: cover;
  }

  .stat-kpi-card {
    min-height: 88px;
  }

  .admin-layout .modal-dialog {
    margin: 0.75rem;
  }

  .recipe-form-modal .recipe-admin-ingredient-row {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    width: min(86vw, 280px);
  }
}

.payment-method-card {
  height: 100%;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: #fff;
}

.payment-method-card .form-check-input:checked {
  background-color: var(--admin-primary);
  border-color: var(--admin-primary);
}

.payment-method-qr {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

.payment-qr-admin-card {
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: #fff;
}

.payment-qr-admin-image {
  display: block;
  width: min(220px, 100%);
  height: auto;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid #e7e5e4;
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}

.payment-qr-admin-empty {
  padding: 1.25rem 1rem;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  text-align: center;
}

.staff-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(circle at top left, rgba(211, 9, 18, 0.35), transparent 34%),
    #0f1b32;
}

.staff-login-card {
  width: min(420px, 100%);
  padding: 32px 28px 26px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(4, 10, 24, 0.35);
}

.staff-login-kicker {
  margin-bottom: 8px;
  color: #d30912;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.staff-login-card h1 {
  margin-bottom: 6px;
  font-size: 1.7rem;
  font-weight: 800;
}

.staff-login-card > p {
  margin-bottom: 22px;
  color: #667085;
  font-size: 0.92rem;
}

.staff-login-note {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f8fa;
  color: #475467;
  font-size: 0.8rem;
}

.staff-login-links {
  margin-top: 18px;
  color: #667085;
  font-size: 0.82rem;
  text-align: center;
}

.staff-login-links a {
  color: #d30912;
  font-weight: 700;
  text-decoration: none;
}

.staff-login-links a:hover {
  text-decoration: underline;
}

.staff-sidebar-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.staff-sidebar-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 600;
}

.staff-sidebar-option:has(input:checked) {
  border-color: #d30912;
  background: #fff5f5;
}

.staff-sidebar-option input {
  accent-color: #d30912;
}

@media (max-width: 575.98px) {
  .staff-sidebar-options {
    grid-template-columns: 1fr;
  }
}

/* Dashboard shell matched to the red-and-white overview */
.admin-topbar.cg-shell {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 26px 6px !important;
  background: #f4f6fb;
  border: 0;
  box-shadow: none;
}

.cg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #1a1d26;
  font-size: 1.55rem;
  line-height: 1;
}

.cg-icon-btn:hover,
.cg-icon-btn:focus-visible {
  background: #fff;
  color: #e10600;
}

.cg-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 180px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid #eef1f6;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 29, 38, 0.04);
}

.cg-search i {
  color: #e10600;
  font-size: 1rem;
}

.cg-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1a1d26;
  font: inherit;
  font-size: 0.92rem;
}

.cg-search input::placeholder {
  color: #b0b7c6;
}

.cg-shell-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.cg-shell .admin-header-bell {
  position: relative;
  top: auto;
  right: auto;
  width: 44px;
  height: 44px;
  border: 1px solid #f3d2d2;
  background: #fff;
  color: #e10600;
  box-shadow: 0 6px 16px rgba(26, 29, 38, 0.04);
}

.cg-userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 5px 16px 5px 5px;
  border: 1px solid #eef1f6;
  border-radius: 999px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(26, 29, 38, 0.04);
}

.cg-userchip small,
.cg-userchip strong {
  display: block;
  line-height: 1.15;
}

.cg-userchip small {
  color: #9aa3b5;
  font-size: 0.68rem;
  font-weight: 600;
}

.cg-userchip strong {
  color: #1a1d26;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.cg-userchip .cg-avatar {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.admin-content-body.cg-dashboard {
  padding: 8px 26px 40px;
}

.cg-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.cg-page-head h1 {
  margin: 0;
  color: #1a1d26;
  font-size: 1.72rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.cg-page-head p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: #8b93a7;
  font-size: 0.92rem;
  font-weight: 600;
}

.cg-accent-dash {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: #e10600;
}

.cg-page-head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cg-chip,
.cg-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  background: #fff;
  color: #3c4353;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(26, 29, 38, 0.04);
  white-space: nowrap;
}

.cg-chip i {
  color: #e10600;
}

.cg-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e10600;
  box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.55);
  animation: cg-pulse 1.6s ease-out infinite;
}

@keyframes cg-pulse {
  70% { box-shadow: 0 0 0 7px rgba(225, 6, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 6, 0, 0); }
}

.cg-heroes,
.cg-metrics,
.cg-charts {
  display: grid;
  gap: 16px;
}

.cg-heroes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cg-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 16px;
}

.cg-charts {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  margin-top: 16px;
}

.cg-hero,
.cg-metric,
.cg-panel {
  border: 1px solid #eef1f6;
  background: #fff;
  box-shadow: 0 10px 28px rgba(26, 29, 38, 0.045);
}

.cg-hero,
.cg-metric {
  color: inherit;
  text-decoration: none;
}

.cg-hero:hover,
.cg-metric:hover,
.cg-hero:focus,
.cg-metric:focus {
  color: inherit;
  text-decoration: none;
  transform: translateY(-2px);
}

.cg-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 178px;
  padding: 18px 18px 16px;
  overflow: hidden;
  border-radius: 22px;
}

.cg-hero-sales {
  border: 0;
  color: #fff;
  background: linear-gradient(145deg, #ff3d32 0%, #e10600 46%, #b40000 100%);
  box-shadow: 0 16px 32px rgba(225, 6, 0, 0.28);
}

.cg-hero-sales:hover,
.cg-hero-sales:focus {
  color: #fff;
}

.cg-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.cg-hero-icon,
.cg-metric-ico,
.cg-hero-go,
.cg-card-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cg-hero-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff0f0;
  color: #e10600;
  font-size: 1.15rem;
}

.cg-hero-sales .cg-hero-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.cg-hero-go {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff5f5;
  color: #e10600;
  font-size: 0.85rem;
}

.cg-kicker {
  display: block;
  margin-top: 16px;
  color: #8b93a7;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cg-hero-sales .cg-kicker {
  color: rgba(255, 255, 255, 0.88);
}

.cg-hero strong {
  margin-top: 6px;
  color: #1a1d26;
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.cg-hero-sales strong {
  color: #fff;
  font-size: 2.45rem;
}

.cg-hero strong.is-hot {
  color: #e10600;
}

.cg-hero-sub,
.cg-hero-meta {
  margin-top: 8px;
  color: #8b93a7;
  font-size: 0.82rem;
  font-weight: 600;
}

.cg-hero-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
}

.cg-hero-line {
  width: 68%;
  height: 3px;
  margin-top: auto;
  border-radius: 99px;
  background: linear-gradient(90deg, #e10600, #ffb4b4);
}

.cg-hero-wave {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 68%;
  height: 82%;
  pointer-events: none;
}

.cg-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 122px;
  padding: 16px 14px 14px;
  border-radius: 20px;
}

.cg-metric-copy {
  min-width: 0;
}

.cg-metric .cg-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.cg-metric-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffe8e8;
  color: #e10600;
  font-size: 0.82rem;
}

.cg-metric strong {
  display: block;
  margin-top: 10px;
  color: #1a1d26;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.cg-metric strong.is-hot,
.cg-metric-sub.is-hot {
  color: #e10600;
}

.cg-metric-sub {
  display: flex;
  align-items: center;
  margin-top: 8px;
  color: #8b93a7;
  font-size: 0.74rem;
  font-weight: 600;
}

.cg-metric-sub.is-up {
  color: #1f9d4d;
}

.cg-metric-sub.is-amber {
  color: #d89a14;
}

.cg-spark {
  width: 74px;
  height: 36px;
  flex: 0 0 auto;
}

.cg-panel {
  min-width: 0;
  padding: 18px 18px 16px;
  border-radius: 22px;
}

.cg-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cg-card-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #1a1d26;
  font-size: 1.02rem;
  font-weight: 800;
}

.cg-card-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffe8e8;
  color: #e10600;
  font-size: 0.9rem;
}

.cg-chart-frame {
  height: 286px;
}

.cg-empty {
  margin: 28px 0;
  color: #8b93a7;
  text-align: center;
}

.cg-bars {
  display: grid;
  gap: 14px;
}

.cg-bar-row,
.cg-bar-scale {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
}

.cg-bar-label {
  color: #4b5568;
  font-size: 0.86rem;
  font-weight: 600;
}

.cg-bar-track {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 22px;
}

.cg-bar-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.cg-bar-fill.is-light {
  color: #9a3030;
}

.cg-bar-pct {
  color: #9aa3b5;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.cg-bar-scale {
  margin-top: 8px;
}

.cg-bar-ticks {
  display: flex;
  justify-content: space-between;
  color: #b0b7c6;
  font-size: 0.72rem;
  font-weight: 600;
}

.cg-dashboard .admin-table-card {
  margin-top: 16px;
  border-color: #eef1f6;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(26, 29, 38, 0.045);
}

.cg-hero:focus-visible,
.cg-metric:focus-visible,
.cg-userchip:focus-visible,
.cg-icon-btn:focus-visible,
.cg-search:focus-within {
  outline: 2px solid #e10600;
  outline-offset: 2px;
}

@media (min-width: 992px) {
  .admin-sidebar,
  .admin-main-wrapper {
    transition: transform 0.25s ease, margin-left 0.25s ease, width 0.25s ease;
  }

  body.is-sidebar-collapsed .admin-sidebar {
    transform: translateX(-100%);
  }

  body.is-sidebar-collapsed .admin-main-wrapper {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 1399.98px) {
  .cg-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199.98px) {
  .cg-heroes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cg-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  body:has(.cg-shell) #adminMenuToggle {
    display: none;
  }

  .admin-topbar.cg-shell {
    padding-left: 16px !important;
  }
}

@media (max-width: 767.98px) {
  .admin-content-body.cg-dashboard {
    padding: 8px 14px 28px;
  }

  .cg-page-head {
    flex-wrap: wrap;
  }

  .admin-topbar.cg-shell {
    flex-wrap: nowrap;
  }

  .cg-heroes,
  .cg-metrics {
    grid-template-columns: 1fr;
  }

  .cg-search {
    flex: 1 1 100%;
    order: 3;
  }

  .cg-shell-tools {
    margin-left: auto;
  }

  .cg-userchip strong {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cg-bar-row,
  .cg-bar-scale {
    grid-template-columns: 92px minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .cg-hero strong,
  .cg-hero-sales strong {
    font-size: 2rem;
  }
}
