html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

/* Theme: indigo accent, Inter, slate backgrounds (applies app-wide) */
:root {
  --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: #0f172a;
  --bs-body-color-rgb: 15, 23, 42;
  --bs-secondary-color: rgba(71, 85, 105, .85);
  --bs-tertiary-bg: #f8fafc;
  --bs-tertiary-bg-rgb: 248, 250, 252;
  --bs-border-color: #e2e8f0;
  --bs-border-radius-lg: .75rem;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-primary-text-emphasis: #3730a3;
  --bs-primary-bg-subtle: #eef2ff;
  --bs-primary-border-subtle: #c7d2fe;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #3730a3;
  --bs-link-hover-color-rgb: 55, 48, 163;
  --bs-focus-ring-color: rgba(79, 70, 229, .25);
}

.btn-primary {
  --bs-btn-bg: #4f46e5;
  --bs-btn-border-color: #4f46e5;
  --bs-btn-hover-bg: #4338ca;
  --bs-btn-hover-border-color: #4338ca;
  --bs-btn-active-bg: #3730a3;
  --bs-btn-active-border-color: #3730a3;
  --bs-btn-disabled-bg: #4f46e5;
  --bs-btn-disabled-border-color: #4f46e5;
}

.btn-outline-primary {
  --bs-btn-color: #4f46e5;
  --bs-btn-border-color: #4f46e5;
  --bs-btn-hover-bg: #4f46e5;
  --bs-btn-hover-border-color: #4f46e5;
  --bs-btn-active-bg: #4338ca;
  --bs-btn-active-border-color: #4338ca;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15);
}

.form-check-input:checked {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

.list-group-item.active {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

.progress-bar {
  background-color: #4f46e5;
}

.card {
  --bs-card-border-color: var(--bs-border-color);
  --bs-card-border-radius: .75rem;
  --bs-card-inner-border-radius: calc(.75rem - 1px);
}

/* App shell: dark sidebar + content */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-content {
  padding: 1.25rem 1rem 2.5rem;
  max-width: 1480px;
}

.sidebar {
  --bs-offcanvas-width: 17rem;
  --bs-offcanvas-bg: #0f172a;
  --bs-offcanvas-color: #e2e8f0;
  display: flex;
  flex-direction: column;
  color: #e2e8f0;
}

@media (min-width: 992px) {
  .app-sidebar {
    width: 17rem;
    flex-shrink: 0;
    background: #0f172a;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .sidebar {
    height: 100%;
  }

  .app-content {
    padding: 2rem 2.5rem 3rem;
  }
}

.sidebar-muted {
  color: #94a3b8;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

/* Back links ("‹ Orders", "‹ PP mapping"): a real button to click or tap, chevron drawn in the text colour */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 2rem;
  max-width: 100%;
  padding: .25rem .8rem .25rem .5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn-back::before {
  content: "";
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn-back:hover {
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary);
}

.btn-back:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* The logo (wwwroot/logo.svg, also the favicon) */
.logo-tile {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .6rem;
  flex-shrink: 0;
  box-shadow: 0 .35rem .9rem rgba(79, 70, 229, .35);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  border-radius: .5rem;
  border: 1px solid transparent;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-link svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(99, 102, 241, .18);
  border-color: rgba(129, 140, 248, .45);
  color: #c7d2fe;
}

.sidebar-section {
  margin: 1.25rem .85rem .35rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: .75rem;
}

.sidebar-user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: #f1f5f9;
}

.sidebar-user-btn:hover,
.sidebar-user-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, .06);
}

.user-tile {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: .8rem;
  font-weight: 700;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #334155;
}

.user-tile-sm {
  width: 2rem;
  height: 2rem;
  font-size: .7rem;
  color: #3730a3;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.mobile-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  z-index: 1020;
}

/* Menus store picker */
.store-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.25rem;
}

@media (max-width: 575.98px) {
  .store-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Brands */
.count-pill {
  padding: .2rem .7rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: var(--bs-body-bg);
  font-size: .8rem;
  color: #334155;
}

.stat-card {
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  background: var(--bs-body-bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #475569;
}

.stat-icon {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 .4rem;
  border-radius: .5rem;
  display: grid;
  place-items: center;
  font-size: .8rem;
  letter-spacing: 0;
}

.stat-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value {
  margin-top: 1.25rem;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-of {
  font-size: .95rem;
  font-weight: 500;
  color: #475569;
}

.stat-note {
  font-size: .85rem;
  font-weight: 500;
  color: #64748b;
  margin-left: .35rem;
}

.tint-indigo { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe !important; }
.tint-blue { background: #eff6ff; color: #2563eb; border-color: #bfdbfe !important; }
.tint-green { background: #ecfdf5; color: #059669; border-color: #a7f3d0 !important; }
.tint-amber { background: #fffbeb; color: #d97706; border-color: #fde68a !important; }
.tint-orange { background: #fff7ed; color: #ea580c; border-color: #fed7aa !important; }
.tint-yellow { background: #fefce8; color: #a16207; border-color: #fef08a !important; }
.tint-red { background: #fef2f2; color: #dc2626; border-color: #fecaca !important; }
.tint-rose { background: #fff1f2; color: #e11d48; border-color: #fecdd3 !important; }
.tint-violet { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe !important; }

.toolbar-card .card-body {
  padding: .9rem 1rem;
}

.toolbar-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
}

.view-toggle button {
  border: 0;
  border-radius: .375rem;
  background: transparent;
  padding: .3rem .45rem;
  color: #64748b;
  line-height: 0;
}

.view-toggle button.active {
  background: var(--bs-body-bg);
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .1);
}

.view-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.brand-card {
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s, box-shadow .15s;
}

.brand-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 .5rem 1.25rem rgba(79, 70, 229, .1);
}

.brand-card .card-body {
  padding: 1.25rem 1.5rem 1rem;
}

.brand-logo {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: .75rem;
  border: 1px solid;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 1rem;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.brand-logo-sm {
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  font-size: .65rem;
}

.code-chip {
  padding: .05rem .5rem;
  border-radius: .35rem;
  background: #f1f5f9;
  font-family: var(--bs-font-monospace);
  font-size: .8rem;
  color: #475569;
}

.currency-chip {
  padding: .05rem .5rem;
  border-radius: .35rem;
  background: #eef2ff;
  font-size: .8rem;
  font-weight: 600;
  color: #4338ca;
}

.brand-owner {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.1rem;
  padding-top: .9rem;
  border-top: 1px solid #f1f5f9;
  font-family: var(--bs-font-monospace);
  font-size: .85rem;
  color: #475569;
}

.brand-owner svg,
.brand-foot svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.5rem;
  border-top: 1px solid var(--bs-border-color);
  background: #f8fafc;
  font-size: .9rem;
}

.brand-foot > span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.ordering-link {
  position: relative; /* above the card's stretched link */
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.ordering-link svg {
  stroke: currentColor;
}

/* Data tables live inside cards */
.card > .table-responsive > .table {
  margin-bottom: 0;
}

.table thead th {
  font-size: .75rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

/* Orders */
.orders-card {
  overflow: hidden;
}

.orders-table > :not(caption) > * > * {
  padding: .7rem 1rem;
}

.orders-table thead th {
  background: var(--bs-body-bg);
}

.orders-table .group-row > td {
  background: var(--bs-tertiary-bg);
  font-size: .8rem;
  padding-block: .5rem;
}

.orders-search {
  width: min(100%, 20rem);
}

.orders-search .search-icon {
  position: absolute;
  left: .6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-secondary-color);
  pointer-events: none;
}

/* Segmented status tabs */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent);
}

.seg-item {
  padding: .3rem .7rem;
  border-radius: .375rem;
  font-size: .85rem;
  color: var(--bs-body-color);
  text-decoration: none;
  white-space: nowrap;
}

.seg-item:hover {
  background: var(--bs-secondary-bg);
}

.seg-item.active {
  background: var(--bs-body-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--bs-border-color-translucent);
  font-weight: 500;
}

.seg-count {
  margin-left: .25rem;
  font-size: .75rem;
  color: var(--bs-secondary-color);
}

/* Soft status pill with a dot */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-success { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.pill-warning { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.pill-danger { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.pill-info { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); }
.pill-primary { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.pill-secondary { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }

.test-tag {
  margin-left: .35rem;
  padding: 0 .35rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .25rem;
  font-size: .7rem;
  color: var(--bs-secondary-color);
  vertical-align: middle;
}

.biz-link:hover {
  text-decoration: underline !important;
}

/* Order details: status timeline */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
}

.step {
  position: relative;
  padding-right: .75rem;
}

/* connector from this dot to the next one */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 26px;
  right: 6px;
  height: 1px;
  background: var(--bs-border-color);
}

.step.done:not(:last-child)::after {
  background: var(--bs-primary);
}

.step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  display: grid;
  place-items: center;
  margin-bottom: .6rem;
  color: #fff;
}

.step.done .step-dot { background: var(--bs-primary); border-color: var(--bs-primary); }
.step.current .step-dot { border-color: var(--bs-primary); }
.step.cancelled .step-dot { background: var(--bs-danger); border-color: var(--bs-danger); }

.step-label {
  font-size: .85rem;
  font-weight: 500;
}

.step.todo .step-label { color: var(--bs-secondary-color); }
.step.cancelled .step-label { color: var(--bs-danger-text-emphasis); }

.step-sub {
  font-size: .75rem;
  color: var(--bs-secondary-color);
}

/* Order details: tables, totals, key/value rows */
.detail-table > :not(caption) > * > * {
  padding: .75rem 1rem;
}

.totals {
  width: min(100%, 15rem);
  font-size: .85rem;
}

.totals > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .2rem 0;
}

.totals dt { font-weight: 400; color: var(--bs-secondary-color); }
.totals dd { margin: 0; white-space: nowrap; }

.totals .grand {
  border-top: 1px solid var(--bs-border-color);
  margin-top: .5rem;
  padding-top: .75rem;
  font-size: 1rem;
  font-weight: 600;
}

.totals .grand dt { color: var(--bs-body-color); font-weight: 600; }

.kv-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 1rem;
  padding: .85rem 1rem;
}

.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .3rem 0;
}

.kv dt { font-weight: 400; color: var(--bs-secondary-color); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; min-width: 0; }

/* Business details */
.field-label {
  margin-bottom: .25rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}

.type-chip {
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.type-chip.on {
  background: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

.type-chip.off {
  border-color: var(--bs-border-color);
  color: #94a3b8;
  text-decoration: line-through;
}

.copy-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: .375rem;
  background: var(--bs-tertiary-bg);
}

@media (max-width: 575.98px) {
  .step-label { font-size: .75rem; }
  .kv-row { grid-template-columns: 1fr auto; }
  .kv-row > :first-child { grid-column: 1 / -1; }
}

.pager-btn {
  --bs-btn-padding-y: .15rem;
  --bs-btn-font-size: .8rem;
}

.filters .form-label {
  font-size: .75rem;
  margin-bottom: .25rem;
  color: var(--bs-secondary-color);
}

dl.kv dt {
  font-weight: 500;
  color: var(--bs-secondary-color);
}

/* Login */
.login-wrap {
  min-height: calc(100vh - 3rem);
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 .5rem 1rem rgba(var(--bs-primary-rgb), .25);
}

.password-toggle {
  border-color: var(--bs-border-color);
  color: var(--bs-secondary-color);
}

.password-toggle:hover,
.password-toggle:focus {
  background: transparent;
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

/* Keep the eye button's border in sync with the focused input. */
.input-group:focus-within .password-toggle {
  border-color: #86b7fe;
}

/* Menu */
/* --nav-h is measured from the navbar by the menu page script (height differs on phones). */
.menu-toolbar {
  top: var(--nav-h, 49px);
  z-index: 1010;
}

.menu-section {
  scroll-margin-top: 150px; /* keep headings clear of navbar + toolbar when jumping */
}

.menu-chips {
  scrollbar-width: none; /* swipeable; the scrollbar is just noise */
}

.menu-chips::-webkit-scrollbar {
  display: none;
}

.menu-side {
  top: calc(var(--nav-h, 49px) + 1rem);
  max-height: calc(100vh - var(--nav-h, 49px) - 2rem);
  overflow-y: auto;
  z-index: 1;
}

.menu-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-secondary-color);
  pointer-events: none;
}

.menu-clear {
  position: absolute;
  right: .25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
}

/* Hide the browser's own clear (x); we render one that also resets the URL. */
#menuSearch::-webkit-search-cancel-button {
  display: none;
}

.menu-card {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.menu-card:hover,
.menu-card:focus-visible {
  border-color: var(--bs-primary);
  box-shadow: 0 .25rem .75rem rgba(var(--bs-primary-rgb), .12);
  outline: none;
}

.menu-hero {
  max-height: 240px;
}

.menu-panel {
  --bs-offcanvas-width: min(480px, 100vw);
}

.menu-item mark {
  background: rgba(var(--bs-warning-rgb), .45);
  border-radius: 2px;
}

.menu-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-thumb {
  background: var(--bs-secondary-bg);
}

/* Indian-style veg / non-veg marker */
.diet-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  margin-right: .35rem;
  position: relative;
  top: 1px;
}

.diet-dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
}

.diet-veg { color: #198754; }
.diet-nonveg { color: #dc3545; }
.diet-egg { color: #fd7e14; }

/* Petpooja JSON check: suggestion buttons with a source badge */
.pp-match .btn {
  text-align: left;
  white-space: normal;
}

.pp-src {
  display: inline-block;
  margin-right: .3rem;
  padding: 0 .3rem;
  border-radius: .25rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.pp-src-ai { background: #ede9fe; color: #6d28d9; }
.pp-src-structure { background: #dcfce7; color: #166534; }
.pp-src-name { background: #f1f5f9; color: #475569; }

.btn-primary .pp-src {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

/* Petpooja price after the suggested name */
.pp-price {
  font-size: .8em;
  opacity: .75;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pp-price::before {
  content: "· ";
}

/* Where the suggestion sits in the Petpooja menu: "of Farmhouse Pizza", "in Extra Cheese (regular)" */
.pp-parent {
  display: block;
  font-size: .75em;
  opacity: .75;
}

.pp-other > summary {
  list-style: none;
  cursor: pointer;
  padding: .15rem .25rem;
}

.pp-other > summary::-webkit-details-marker {
  display: none;
}

/* Petpooja check: popup confirming items switched off at one outlet */
.pp-disable-modal {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, .25);
}

.pp-disable-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
}

.pp-disable-outlet {
  padding: .75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  background: var(--bs-tertiary-bg);
}

.pp-disable-list .list-group-item {
  padding: .5rem .85rem;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

/* PP mapping gaps */
.map-toolbar {
  top: var(--nav-h, 49px);
  z-index: 1010;
}

.map-section {
  scroll-margin-top: 130px;
}

.map-tile:hover {
  border-color: var(--bs-primary);
}

pre.raw {
  max-height: 60vh;
  overflow: auto;
}

/* Phones: list tables become stacked cards; each cell is labelled from data-label. */
@media (max-width: 767.98px) {
  .table-stack thead {
    display: none;
  }

  .table-stack tr {
    display: block;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .table-stack td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .15rem 0;
    border: 0;
    text-align: right !important;
  }

  .table-stack td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: .75rem;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    text-align: left;
  }

  /* First cell is the card title; action cells span the card. */
  .table-stack td.stack-title {
    font-size: 1.05rem;
    justify-content: flex-start;
    text-align: left !important;
    padding-bottom: .35rem;
  }

  .table-stack td.stack-title > div {
    display: none;
  }

  .table-stack td.stack-actions {
    justify-content: flex-end;
    padding-top: .5rem;
  }

  .table-stack td:empty {
    display: none;
  }

  .filters .btn {
    flex: 1;
  }
}

/* ── Task Manager ─────────────────────────────────────────────── */

.assignee-chip {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: .72rem;
  font-weight: 500;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* "Assign to" multi-select dropdown (looks like a select, opens a checkbox list) */
.assignee-dropdown .assignee-menu {
  max-height: 16rem;
  overflow-y: auto;
}

/* Attachments grid */
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}

.attachment-card {
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.attachment-preview {
  height: 140px;
  background: var(--bs-tertiary-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.attachment-preview img,
.attachment-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-zip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.attachment-zip-icon { font-size: 2rem; }

.attachment-meta {
  padding: .5rem .6rem;
  font-size: .8rem;
  border-top: 1px solid var(--bs-border-color);
}

/* Activity panel (Jira-style: tabs + merged comment / history feed) */
.activity-tabs { font-size: .9rem; }
.activity-tabs .nav-link { padding: .35rem .75rem; color: var(--bs-secondary-color); }
.activity-tabs .nav-link.active { color: var(--bs-primary); font-weight: 500; }

.activity-stream { display: flex; flex-direction: column; }
.activity-stream.newest-first { flex-direction: column-reverse; }
.activity-stream.filter-comments [data-kind="history"] { display: none; }
.activity-stream.filter-history [data-kind="comment"] { display: none; }

.activity-item {
  display: flex;
  gap: .7rem;
  padding: .85rem 0;
  border-top: 1px solid var(--bs-border-color);
}

.activity-avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: .85rem;
}

.activity-avatar-sys { background: var(--bs-secondary-color); }

.activity-content { flex: 1 1 auto; min-width: 0; }

.activity-head {
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: baseline;
}

.activity-author { font-weight: 600; color: var(--bs-primary-text-emphasis); }
.activity-text { margin-top: .25rem; }

.activity-actions {
  margin-top: .3rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.link-action {
  background: none;
  border: 0;
  padding: 0;
  font-size: .8rem;
  color: var(--bs-secondary-color);
  cursor: pointer;
}

.link-action:hover { color: var(--bs-primary); text-decoration: underline; }
.link-danger:hover { color: var(--bs-danger); }

/* Kanban board */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: .75rem;
  overflow-x: auto;
}

.kanban-col {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  padding: .5rem;
  min-height: 8rem;
}

.kanban-col.drop-hover {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 2px var(--bs-primary-bg-subtle) inset;
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: .85rem;
  padding: .25rem .35rem .5rem;
}

.kanban-col-body { display: flex; flex-direction: column; gap: .5rem; }

.kanban-card {
  display: block;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  padding: .6rem;
  text-decoration: none;
  color: inherit;
  cursor: grab;
}

.kanban-card:hover { border-color: var(--bs-primary); }
.kanban-card.dragging { opacity: .5; }

@media (max-width: 575.98px) {
  .kanban { grid-template-columns: 1fr; }
}

/* Collapsible sidebar (desktop): the chevron next to the brand shrinks it to icons only; site.js remembers the choice. */
.sidebar-toggle {
  place-items: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: .4rem;
  background: transparent;
  color: #94a3b8;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}

@media (min-width: 992px) {
  .app-sidebar {
    transition: width .2s;
  }

  .sidebar-collapsed .app-sidebar {
    width: 4.5rem;
  }

  .sidebar-collapsed .sidebar .sidebar-label {
    display: none !important;
  }

  .sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    gap: .75rem;
    padding: 1rem .5rem;
  }

  .sidebar-collapsed .sidebar-toggle {
    margin-left: 0;
  }

  .sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
  }

  .sidebar-collapsed .sidebar-nav {
    padding: 1rem .5rem;
  }

  .sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: .6rem;
  }

  .sidebar-collapsed .sidebar-section {
    margin: .75rem .25rem .25rem;
    padding-top: .5rem;
    font-size: 0;
  }

  .sidebar-collapsed .sidebar-user {
    padding: .75rem .5rem;
  }

  .sidebar-collapsed .sidebar-user-btn {
    justify-content: center;
    padding: .25rem 0;
  }
}

/* Chat link's unread badge (site.js); a small dot when the sidebar is collapsed to icons. */
.sidebar-link:has(.sidebar-badge) {
  position: relative;
}

.sidebar-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  padding: 0 .4rem;
  border-radius: 999px;
  background: #6366f1;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}

.sidebar-badge.mention {
  background: #ef4444;
}

.sidebar-badge[hidden] {
  display: none;
}

/* The same count as a dot on the phone menu button. */
.sidebar-badge-dot {
  position: absolute;
  top: .1rem;
  right: .1rem;
  min-width: 0;
  width: .6rem;
  height: .6rem;
  padding: 0;
  font-size: 0;
  box-shadow: 0 0 0 2px #fff;
}

@media (min-width: 992px) {
  .sidebar-collapsed .sidebar-badge {
    position: absolute;
    top: .4rem;
    right: .55rem;
    min-width: 0;
    width: .6rem;
    height: .6rem;
    padding: 0;
    font-size: 0;
    box-shadow: 0 0 0 2px #0f172a;
  }
}
