:root {
  /* Brand */
  --pp-sidebar-bg: #072a12;
  --pp-sidebar-bg-2: #0a3a19;
  --pp-sidebar-active: #0f5f24;
  --pp-sidebar-text: #FFFFFF;
  --pp-sidebar-muted: #9FBFAC;
  --pp-primary: #106C2C;
  --pp-primary-strong: #0C5522;
  --pp-primary-soft: #E8F3EA;
  --pp-primary-ring: rgba(16, 108, 44, 0.18);
  --pp-accent: #EC6000;
  --pp-accent-strong: #CE5300;
  --pp-accent-soft: #FFF1E6;
  --pp-danger: #B41400;
  --pp-danger-strong: #8E1000;
  --pp-danger-soft: #FDECEC;

  /* Surfaces */
  --pp-bg: #F4F6F5;
  --pp-bg-translucent: rgba(244, 246, 245, 0.85);
  --pp-surface: #FFFFFF;
  --pp-surface-muted: #FAFBFA;
  --pp-border: #E1E4E2;
  --pp-border-strong: #CDD2CF;
  --pp-row-hover: #F1F7F2;

  /* Text */
  --pp-text: #10221B;
  --pp-text-muted: #667772;

  /* Charts (read by dashboard JS — keep these names) */
  --pp-chart-1: #106C2C;
  --pp-chart-2: #EC6000;
  --pp-chart-3: #2F9D21;

  /* Scale */
  --pp-radius-sm: 8px;
  --pp-radius: 12px;
  --pp-radius-lg: 16px;
  --pp-shadow-sm: 0 1px 2px rgba(16, 34, 27, 0.05), 0 1px 3px rgba(16, 34, 27, 0.06);
  --pp-shadow-md: 0 4px 12px rgba(16, 34, 27, 0.08), 0 2px 4px rgba(16, 34, 27, 0.05);
  --pp-shadow-lg: 0 16px 40px rgba(16, 34, 27, 0.16);
  --pp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--pp-font);
  font-size: 14px;
  line-height: 1.55;
  background: var(--pp-bg);
  color: var(--pp-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, select, textarea, button { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.25; }

a { color: var(--pp-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--pp-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--pp-border-strong);
  border-radius: 999px;
  border: 2px solid var(--pp-bg);
}
::-webkit-scrollbar-thumb:hover { background: #b3b9b5; }

/* ------------------------------------------------------------------ *
 *  Auth
 * ------------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(47, 157, 33, 0.35), transparent 60%),
    linear-gradient(155deg, #072a12 0%, #0f5f24 42%, #F4F6F5 42%, #F4F6F5 100%);
  padding: 24px;
}

.auth-card {
  width: min(430px, 100%);
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-lg);
  padding: 36px 34px;
  box-shadow: var(--pp-shadow-lg);
  animation: pp-pop 0.28s ease both;
}
.auth-card .form-grid { max-width: none; gap: 16px; }
.auth-card .btn { width: 100%; text-align: center; padding: 12px 16px; }

.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.brand .pag { color: var(--pp-chart-3); }
.brand-dark .pedi { color: var(--pp-text); }
.brand-dark .pag { color: var(--pp-chart-3); }
.tagline { color: var(--pp-text-muted); margin: 0 0 26px; font-size: 14px; }

/* ------------------------------------------------------------------ *
 *  Layout
 * ------------------------------------------------------------------ */
.layout { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 262px;
  background: linear-gradient(180deg, var(--pp-sidebar-bg-2) 0%, var(--pp-sidebar-bg) 100%);
  color: var(--pp-sidebar-text);
  padding: 24px 16px;
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: nowrap;
  transition: width 0.22s ease, padding 0.22s ease, transform 0.22s ease;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
body.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-backdrop { display: none; }

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-sm);
  font-size: 16px;
  line-height: 1;
  color: var(--pp-text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sidebar-toggle:hover { background: var(--pp-primary-soft); border-color: var(--pp-primary); }

.sidebar .brand { color: #fff; font-size: 22px; }
.sidebar .brand .pag { color: #7CFF7A; }

.sidebar nav { margin-top: 26px; display: grid; gap: 3px; }
.sidebar a {
  color: var(--pp-sidebar-muted);
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}
.sidebar a.active {
  background: var(--pp-sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #7CFF7A;
}

.sidebar-group { border-radius: 10px; }
.sidebar-group summary {
  color: var(--pp-sidebar-muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary::after {
  content: '›';
  font-size: 16px;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}
.sidebar-group[open] summary::after { transform: rotate(-90deg); }
.sidebar-group summary:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar-group summary.active { background: var(--pp-sidebar-active); color: #fff; font-weight: 600; }
.sidebar-submenu { display: grid; gap: 2px; padding: 4px 0 6px 12px; }
.sidebar-submenu a { font-size: 13px; }

.content {
  flex: 1;
  min-width: 0;
  padding: 30px 34px 44px;
  animation: pp-fade 0.22s ease both;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -30px -34px 26px;
  padding: 14px 34px;
  background: var(--pp-bg-translucent);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--pp-border);
}
.topbar h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .muted { margin-top: 1px; }

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--pp-text-muted);
  white-space: nowrap;
}

.muted { color: var(--pp-text-muted); font-size: 13px; }

/* ------------------------------------------------------------------ *
 *  Stat cards
 * ------------------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.card {
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-lg);
  padding: 18px;
  box-shadow: var(--pp-shadow-sm);
}
.card .label {
  color: var(--pp-text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card .value { font-size: 27px; font-weight: 700; margin-top: 8px; letter-spacing: -0.01em; }
.card .accent { color: var(--pp-accent); }

/* ------------------------------------------------------------------ *
 *  Panels
 * ------------------------------------------------------------------ */
.panel {
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-lg);
  padding: 20px;
  overflow: auto;
  box-shadow: var(--pp-shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.panel h4 { margin: 18px 0 10px; font-size: 13.5px; font-weight: 700; }
.panel > p:first-of-type { margin-top: 0; }

/* ------------------------------------------------------------------ *
 *  Tables
 * ------------------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--pp-border); }
th {
  color: var(--pp-text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--pp-surface);
  position: sticky;
  top: 0;
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--pp-row-hover); }
tbody tr:last-child td { border-bottom: none; }
tr.closed-no-purchase td { text-decoration: line-through; color: var(--pp-text-muted); }

/* ------------------------------------------------------------------ *
 *  Pagination
 * ------------------------------------------------------------------ */
.pp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
}
.pp-pagination-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--pp-border-strong);
  border-radius: var(--pp-radius-sm);
  background: var(--pp-surface);
  color: var(--pp-text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
a.pp-pagination-btn:hover {
  background: var(--pp-primary-soft);
  border-color: var(--pp-primary);
  color: var(--pp-primary-strong);
  text-decoration: none;
}
.pp-pagination-btn.is-current {
  background: var(--pp-primary);
  border-color: var(--pp-primary);
  color: #fff;
}
.pp-pagination-btn.is-disabled { opacity: 0.45; cursor: not-allowed; }
.pp-pagination-ellipsis { padding: 0 4px; color: var(--pp-text-muted); }
.pp-pagination-info {
  margin-left: auto;
  color: var(--pp-text-muted);
  font-weight: 400;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ *
 *  Buttons
 * ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 15px;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.06s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--pp-primary); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--pp-primary); color: #fff; box-shadow: var(--pp-shadow-sm); }
.btn-primary:hover { background: var(--pp-primary-strong); }
.btn-accent { background: var(--pp-accent); color: #fff; box-shadow: var(--pp-shadow-sm); }
.btn-accent:hover { background: var(--pp-accent-strong); }
.btn-danger { background: var(--pp-danger); color: #fff; box-shadow: var(--pp-shadow-sm); }
.btn-danger:hover { background: var(--pp-danger-strong); }
.btn-ghost { background: var(--pp-surface); border-color: var(--pp-border-strong); color: var(--pp-text); }
.btn-ghost:hover { background: var(--pp-primary-soft); border-color: var(--pp-primary); color: var(--pp-primary-strong); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }

/* ------------------------------------------------------------------ *
 *  Forms
 * ------------------------------------------------------------------ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 20px;
  max-width: 940px;
  align-items: start;
}
.form-grid.panel { padding: 22px; }
.form-grid > h3,
.form-grid > h4,
.form-grid > p,
.form-grid > hr,
.form-grid > .actions,
.form-grid > button,
.form-grid > [type="submit"],
.form-grid > a,
.form-grid > label:has(.actions),
.form-grid > label:has(textarea) {
  grid-column: 1 / -1;
}
.form-grid > h3 { margin: 8px 0 0; }
.form-grid > h3:first-child { margin-top: 0; }
.form-grid > button,
.form-grid > [type="submit"],
.form-grid > a { justify-self: start; }

label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--pp-text-muted); }

/* Inline flex/action rows: keep native control sizing instead of stretching */
.actions :is(input, select):not([type="checkbox"]):not([type="radio"]),
form[style*="flex"] :is(input, select):not([type="checkbox"]):not([type="radio"]) {
  width: auto;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--pp-border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--pp-text);
  background: var(--pp-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input::placeholder, textarea::placeholder { color: #9AA6A1; }
input:hover, select:hover, textarea:hover { border-color: #B7BEBA; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pp-primary);
  box-shadow: 0 0 0 3px var(--pp-primary-ring);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667772' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
input[type="file"] {
  padding: 8px 12px;
  background: var(--pp-surface-muted);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 1px solid var(--pp-border-strong);
  background: var(--pp-surface);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--pp-text);
}

/* ------------------------------------------------------------------ *
 *  Alerts
 * ------------------------------------------------------------------ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--pp-radius);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
  animation: pp-slide-down 0.25s ease both;
}
.alert::before { font-size: 15px; line-height: 1.3; }
.alert-error { background: var(--pp-danger-soft); color: var(--pp-danger-strong); border-color: rgba(180, 20, 0, 0.18); }
.alert-error::before { content: "⚠"; }
.alert-success { background: var(--pp-primary-soft); color: var(--pp-primary-strong); border-color: rgba(16, 108, 44, 0.18); }
.alert-success::before { content: "✓"; }
.alert-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.alert-dismiss:hover { opacity: 1; }
.alert-hide { animation: pp-slide-up 0.25s ease both; }

/* ------------------------------------------------------------------ *
 *  Badges
 * ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--pp-primary-soft);
  color: var(--pp-primary-strong);
  white-space: nowrap;
}
.badge-offline { background: #EDEFEE; color: var(--pp-text-muted); }
.badge-prep-pending { background: var(--pp-accent-soft); color: var(--pp-accent-strong); }
.badge-prep-preparing { background: var(--pp-primary-soft); color: var(--pp-primary-strong); }
.badge-prep-ready { background: #E4F5E1; color: #1F7A16; }
.badge-cancelled { background: #EDEFEE; color: var(--pp-text-muted); text-decoration: line-through; }
.badge-danger { background: var(--pp-danger-soft); color: var(--pp-danger-strong); }

/* ------------------------------------------------------------------ *
 *  Entity cards (orders / deliveries / lists)
 * ------------------------------------------------------------------ */
.order-cards,
.delivery-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.list-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.order-card,
.delivery-card,
.list-card {
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-left: 4px solid var(--pp-border-strong);
  border-radius: var(--pp-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--pp-shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.order-card:hover,
.delivery-card:hover,
.list-card:hover { transform: translateY(-2px); box-shadow: var(--pp-shadow-md); }

.order-card--pending { border-left-color: var(--pp-accent); }
.order-card--preparing { border-left-color: var(--pp-primary); }
.delivery-card--searching { border-left-color: var(--pp-accent); }
.delivery-card--progress,
.delivery-card--delivered { border-left-color: var(--pp-primary); }
.delivery-card--cancelled { border-left-color: var(--pp-danger); }
.list-card--open { border-left-color: var(--pp-accent); }
.list-card--progress { border-left-color: var(--pp-primary); }
.list-card--failed { border-left-color: var(--pp-danger); }
.list-card--cancelled { border-left-color: var(--pp-border-strong); }

.order-card-header,
.delivery-card-header,
.list-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.order-card-company,
.delivery-card-id,
.list-card-id { font-weight: 700; font-size: 15px; }
.order-card-dish,
.list-card-dish { color: var(--pp-text-muted); font-size: 13px; margin-top: -8px; }
.delivery-card-list { margin-top: -8px; }
.delivery-card-info { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.delivery-card-info-label { color: var(--pp-text-muted); margin-right: 4px; }

.order-card-stats,
.delivery-card-stats,
.list-card-stats { display: flex; gap: 24px; }
.order-card-stat,
.delivery-card-stat,
.list-card-stat { display: flex; flex-direction: column; }
.order-card-stat-value { font-size: 22px; font-weight: 700; }
.delivery-card-stat-value,
.list-card-stat-value { font-size: 18px; font-weight: 700; }
.order-card-stat-label,
.delivery-card-stat-label,
.list-card-stat-label {
  color: var(--pp-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.order-card .actions,
.delivery-card .actions,
.list-card .actions { margin-top: auto; }
.order-card .actions form,
.delivery-card .actions form { display: contents; }

/* Empty states inside card grids */
.order-cards > p.muted:only-child,
.delivery-cards > p.muted:only-child,
.list-cards > p.muted:only-child {
  grid-column: 1 / -1;
  margin: 0;
  padding: 44px 20px;
  text-align: center;
  font-size: 13.5px;
  background: var(--pp-surface);
  border: 1px dashed var(--pp-border-strong);
  border-radius: var(--pp-radius-lg);
}

/* ------------------------------------------------------------------ *
 *  Delivery timeline history
 * ------------------------------------------------------------------ */
.timeline-history { margin-top: 16px; }
.timeline-history-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--pp-text-muted);
}
.timeline-history table { font-size: 12px; }
.timeline-history th, .timeline-history td { padding: 6px 8px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ *
 *  Alert bell + toasts
 * ------------------------------------------------------------------ */
.alert-bell { position: relative; }
.alert-bell-toggle {
  position: relative;
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.alert-bell-toggle:hover { background: var(--pp-primary-soft); border-color: var(--pp-primary); }
.alert-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--pp-danger);
  color: #fff;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  line-height: 1.4;
  border: 2px solid var(--pp-bg);
}
.alert-bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 330px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius);
  box-shadow: var(--pp-shadow-lg);
  z-index: 100;
  animation: pp-pop 0.16s ease both;
}
.alert-bell-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pp-border);
  font-size: 13px;
  position: sticky;
  top: 0;
  background: var(--pp-surface);
}
.alert-bell-panel-header button {
  background: none;
  border: none;
  color: var(--pp-primary);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.alert-bell-panel-header button:hover { text-decoration: underline; }
.alert-bell-list { list-style: none; margin: 0; padding: 0; }
.alert-bell-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--pp-border);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alert-bell-item:last-child { border-bottom: none; }
.alert-bell-item button {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--pp-border-strong);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  color: var(--pp-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.alert-bell-item button:hover { background: var(--pp-primary-soft); color: var(--pp-primary-strong); }

.alert-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.alert-toast {
  background: var(--pp-surface);
  color: var(--pp-text);
  border: 1px solid var(--pp-border);
  border-left: 4px solid var(--pp-accent);
  border-radius: var(--pp-radius);
  padding: 12px 14px;
  font-size: 13px;
  box-shadow: var(--pp-shadow-lg);
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: pp-slide-left 0.28s ease both;
}
.alert-toast-hide { opacity: 0; transform: translateX(12px); }

/* ------------------------------------------------------------------ *
 *  Animations
 * ------------------------------------------------------------------ */
@keyframes pp-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@keyframes pp-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes pp-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes pp-slide-up {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-8px); }
}
@keyframes pp-slide-left {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ *
 *  Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 260px;
    padding: 24px 16px;
    transform: translateX(0);
    box-shadow: var(--pp-shadow-lg);
  }
  body.sidebar-collapsed .sidebar {
    width: 260px;
    padding: 24px 16px;
    transform: translateX(-100%);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(7, 26, 15, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  body:not(.sidebar-collapsed) .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  .content { padding: 18px 16px 40px; }
  .topbar { margin: -18px -16px 20px; padding: 12px 16px; }
  .topbar h1 { font-size: 18px; }
  .topbar-user { display: none; }
}

/* Dashboard / sponsor two-up chart rows stack before the panels get too narrow */
@media (max-width: 900px) {
  .cards[style*="2fr 1fr"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .value { font-size: 22px; }
  .order-cards, .delivery-cards, .list-cards { grid-template-columns: 1fr; }
  .pp-pagination-info { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sidebar, .sidebar-backdrop, .topbar, .actions, .alert-toast-container { display: none !important; }
  .content { padding: 0; }
  .panel, .card { box-shadow: none; border-color: #ccc; }
}
