:root {
  --lp-navy: #101a35;
  --lp-navy-active: #16224a;
  --lp-navy-border: rgba(255, 255, 255, 0.08);
  --lp-teal: #14b8a6;
  --lp-teal-dark: #0d9488;
  --lp-bg: #f3f4f6;
  --lp-card-bg: #ffffff;
  --lp-border: #e5e7eb;
  --lp-text: #111827;
  --lp-text-muted: #6b7280;
  --lp-radius: 0.85rem;
  --lp-sidebar-width: 256px;

  /* per-theme overridable colors (see Settings) */
  --lp-sidebar-bg: var(--lp-navy);
  --lp-sidebar-active-bg: var(--lp-navy-active);
}

body {
  background-color: var(--lp-bg);
  color: var(--lp-text);
  margin-bottom: 0;
}

/* ---------- App shell / sidebar ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--lp-sidebar-width);
  flex-shrink: 0;
  background: var(--lp-sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left 0.2s ease;
}

.app-shell.sidebar-collapsed .app-sidebar {
  margin-left: calc(var(--lp-sidebar-width) * -1);
}

.app-sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.app-sidebar .brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--lp-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo {
  max-height: 32px;
  max-width: 160px;
  object-fit: contain;
  flex-shrink: 0;
}

.app-sidebar .brand .brand-name {
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 0;
}

.app-sidebar .nav-section-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 1.25rem;
  margin-top: 0.5rem;
}

.app-sidebar .nav {
  flex: 1;
  padding: 0 0.75rem;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.app-sidebar .nav-link svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.app-sidebar .nav-link:hover {
  background: var(--lp-sidebar-active-bg);
  color: #fff;
}

.app-sidebar .nav-link.active {
  background: var(--lp-sidebar-active-bg);
  color: #fff;
  font-weight: 600;
}

.app-sidebar .sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--lp-navy-border);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.app-sidebar .sidebar-footer .user-name {
  color: #fff;
  font-weight: 600;
  display: block;
}

.app-sidebar .sidebar-footer form button {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: 0;
  font-size: 0.85rem;
}

.app-sidebar .sidebar-footer form button:hover {
  color: #fff;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: #fff;
  border-bottom: 1px solid var(--lp-border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-topbar .sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--lp-text-muted);
  display: flex;
  align-items: center;
  padding: 0.25rem;
}

.app-topbar .page-title {
  font-weight: 600;
  color: var(--lp-text);
}

.app-content {
  padding: 1.75rem;
  flex: 1;
}

/* ---------- Cards ---------- */

.lp-card {
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.stat-card {
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-card .stat-label {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--lp-text-muted);
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.stat-card .icon-box {
  width: 42px;
  height: 42px;
  border-radius: 0.65rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lp-text-muted);
  flex-shrink: 0;
}

.stat-card .icon-box.accent {
  background: var(--lp-teal);
  color: #fff;
}

/* ---------- Buttons ---------- */

.btn-navy {
  background-color: var(--lp-navy);
  border-color: var(--lp-navy);
  color: #fff;
}

.btn-navy:hover, .btn-navy:focus {
  background-color: var(--lp-navy-active);
  border-color: var(--lp-navy-active);
  color: #fff;
}

.btn-teal {
  background-color: var(--lp-teal);
  border-color: var(--lp-teal);
  color: #fff;
}

.btn-teal:hover, .btn-teal:focus {
  background-color: var(--lp-teal-dark);
  border-color: var(--lp-teal-dark);
  color: #fff;
}

.link-teal {
  color: var(--lp-teal-dark);
  text-decoration: none;
  font-weight: 600;
}

.link-teal:hover {
  color: var(--lp-teal);
}

/* ---------- Pills / badges ---------- */

.pill {
  display: inline-block;
  background: #f3f4f6;
  color: var(--lp-text-muted);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge.status-draft { background: #e5e7eb; color: #374151; }
.status-badge.status-pendingpayment { background: #fef3c7; color: #92400e; }
.status-badge.status-awaitingprocessing { background: #dbeafe; color: #1e40af; }
.status-badge.status-processing { background: #ede9fe; color: #5b21b6; }
.status-badge.status-completed { background: #d1fae5; color: #065f46; }

.status-badge.status-pending { background: #fef3c7; color: #92400e; }
.status-badge.status-paid { background: #d1fae5; color: #065f46; }
.status-badge.status-partial { background: #dbeafe; color: #1e40af; }
.status-badge.status-cancelledvoid { background: #fee2e2; color: #991b1b; }

.status-badge.status-notready { background: #e5e7eb; color: #374151; }
.status-badge.status-ready { background: #dbeafe; color: #1e40af; }
.status-badge.status-outfordelivery { background: #ede9fe; color: #5b21b6; }
.status-badge.status-pickedup { background: #d1fae5; color: #065f46; }
.status-badge.status-delivered { background: #d1fae5; color: #065f46; }
.status-badge.status-faileddelivery { background: #fee2e2; color: #991b1b; }

/* ---------- Auth layout ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lp-bg);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

.auth-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--lp-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand.has-logo {
  flex-direction: column;
  gap: 0.4rem;
}

.auth-brand.has-logo .brand-logo {
  max-height: 64px;
  max-width: 240px;
}

/* ---------- Service & product cards ---------- */

.service-card .form-check-input {
  width: 2.5em;
  height: 1.4em;
}

.service-card .form-check-input:checked {
  background-color: var(--lp-teal);
  border-color: var(--lp-teal);
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--lp-border);
}

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

/* ---------- Product tiles (order entry) ---------- */

.tile-group-title {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--lp-text-muted);
  margin: 1.25rem 0 0.6rem;
}

.tile-group-title:first-child {
  margin-top: 0;
}

.product-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.product-tile-grid + .tile-group-title {
  margin-top: 1.25rem;
}

.product-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  padding: 0.9rem 0.5rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-tile:hover {
  border-color: var(--lp-teal);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.08);
}

.product-tile .tile-icon {
  color: var(--lp-text-muted);
}

.product-tile .tile-name {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.product-tile .tile-price {
  font-size: 0.76rem;
  color: var(--lp-text-muted);
}

.product-tile .tile-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--lp-teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Icon picker (Add/Edit Product modal) ---------- */

.icon-picker-btn {
  padding: 0.4rem 0.6rem;
}

.icon-picker-btn.active {
  background-color: var(--lp-navy);
  border-color: var(--lp-navy);
  color: #fff;
}

/* ---------- Cart ---------- */

.cart-table th, .cart-table td {
  vertical-align: middle;
}

.payment-row .payment-method {
  max-width: 150px;
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    z-index: 1050;
    margin-left: calc(var(--lp-sidebar-width) * -1);
  }

  .app-shell.sidebar-collapsed .app-sidebar {
    margin-left: 0;
  }
}
