:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --ink: #17211f;
  --muted: #69716e;
  --line: #d9ddd6;
  --accent: #25635a;
  --accent-2: #b85f35;
  --warn: #b7791f;
  --danger: #b42318;
  --ok: #1f7a4d;
  --shadow: 0 8px 24px rgba(23, 33, 31, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
}

button:active {
  transform: translateY(1px);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 4px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  background: #fbfaf7;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.icon-btn {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 24px;
}

.tabs {
  position: sticky;
  top: 70px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px 10px;
  background: #fbfaf7;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 38px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.tab.active {
  background: var(--accent);
  color: white;
}

main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 14px 12px 32px;
}

#resetBtn {
  display: none;
}

.period-bar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.period-bar .search-box {
  margin: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar.split {
  align-items: end;
}

.search-box {
  flex: 1;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-box.compact {
  flex: 0 0 118px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.import-file {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.list {
  display: grid;
  gap: 10px;
}

.list.single {
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.qty-control {
  display: grid;
  grid-template-columns: 38px 68px 38px;
  gap: 4px;
  align-items: center;
}

.qty-control button {
  min-height: 38px;
  padding: 0;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 20px;
}

.qty-control input {
  min-height: 38px;
  padding: 0 6px;
  text-align: center;
  font-weight: 800;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill.warn {
  background: #fff4dc;
  color: var(--warn);
}

.pill.danger {
  background: #fee4e2;
  color: var(--danger);
}

.pill.ok {
  background: #dff3e8;
  color: var(--ok);
}

.money {
  color: var(--accent-2);
  font-weight: 800;
}

.grid-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

dialog {
  width: min(560px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

dialog::backdrop {
  background: rgba(23, 33, 31, .42);
}

.dialog-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
}

.dialog-panel h2 {
  margin: 0;
  font-size: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button[value="cancel"],
.danger-btn,
.secondary-btn {
  background: var(--surface-2);
  color: var(--accent);
}

.danger-btn {
  color: var(--danger);
}

.grid-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.grid-fields label.wide {
  grid-column: 1 / -1;
}

.category-block {
  display: grid;
  gap: 10px;
}

.category-title {
  margin: 8px 0 0;
  padding: 8px 2px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.line-items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.line-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.line-item:first-child {
  border-top: 0;
}

.line-item strong {
  text-align: right;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.status-select {
  min-height: 36px;
  max-width: 150px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loss-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.loss-table th,
.loss-table td {
  border: 1px solid #6f7774;
  padding: 6px 7px;
  text-align: right;
  vertical-align: middle;
}

.loss-table th {
  background: #e9f0f7;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.loss-table td:nth-child(2),
.loss-table td:nth-child(3),
.loss-table td:nth-child(4) {
  text-align: left;
}

.loss-table input {
  min-height: 32px;
  width: 92px;
  padding: 0 6px;
  text-align: right;
}

.receive-controls {
  display: grid;
  grid-template-columns: minmax(76px, 100px) minmax(110px, 140px);
  gap: 6px;
  justify-items: stretch;
}

.receive-controls .mini-btn {
  grid-column: 1 / -1;
}

.receive-controls input,
.receive-controls select {
  min-height: 36px;
  padding: 0 8px;
}

.order-line-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  border-top: 0;
}

.order-qty-heading {
  align-items: center;
  text-align: center;
}

.notice {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.4;
}

.empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .55);
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
  display: none;
  background: #17211f;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}

.toast.show {
  display: block;
}

.notification-panel {
  width: min(420px, calc(100vw - 28px));
  padding: 16px;
}

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

.notification-head h2 {
  margin: 0;
  font-size: 20px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  width: 100%;
  display: grid;
  gap: 5px;
  min-height: 0;
  padding: 13px 14px;
  border-radius: 16px;
  text-align: left;
  background: #f8fafc;
  color: var(--ink);
}

.notification-item strong {
  font-size: 15px;
}

.notification-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.notification-item.warn {
  background: #fff7ed;
}

.notification-item.danger {
  background: #fee2e2;
}

.notify-btn span[hidden] {
  display: none;
}

/* Blue workflow mockup pass */
:root {
  --accent: #0b56d6;
  --accent-dark: #0a3fa3;
  --accent-soft: #eaf2ff;
  --ok: #16a34a;
  --warn: #f59e0b;
  --danger: #ef4444;
}

body {
  background:
    radial-gradient(circle at 8% 6%, rgba(37, 99, 235, .13), transparent 24%),
    radial-gradient(circle at 94% 4%, rgba(14, 165, 233, .12), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
}

.login-panel::before {
  content: "";
  height: 128px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 38%, #fde68a 0 14%, transparent 15%),
    radial-gradient(circle at 62% 44%, #22c55e 0 17%, transparent 18%),
    radial-gradient(circle at 76% 52%, #ef4444 0 10%, transparent 11%),
    linear-gradient(135deg, #eff6ff, #ffffff);
}

.login-panel button,
.primary-wide,
.solution-stack button {
  background: linear-gradient(180deg, #1467f2, #0b56d6);
  box-shadow: 0 12px 26px rgba(11, 86, 214, .22);
}

.app-header {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid #dbeafe;
}

.app-header h1,
.section-head h2,
.home-hero h2 {
  color: #0f172a;
}

.eyebrow,
.tab.active,
.section-head button {
  color: var(--accent);
}

.tab.active {
  background: var(--accent-soft);
}

.home-hero {
  background:
    radial-gradient(circle at 78% 34%, rgba(34, 197, 94, .34), transparent 20%),
    radial-gradient(circle at 92% 58%, rgba(249, 115, 22, .2), transparent 18%),
    linear-gradient(135deg, #ffffff 0%, #e7f1ff 54%, #f0fdf4 100%);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: 62px;
  top: 20px;
  width: 56px;
  height: 38px;
  border: 3px solid #dbeafe;
  border-bottom: 0;
  border-radius: 50% 50% 8px 8px;
  background: white;
  transform: rotate(-8deg);
}

.summary-grid article,
.home-panel,
.card,
.recipe-cover,
.inventory-summary,
.order-table-card,
.quick-grid button,
.feature-strip article {
  border-color: #d8e6fb;
  box-shadow: 0 10px 28px rgba(30, 64, 175, .08);
}

.task-flow {
  display: grid;
  gap: 10px;
}

.task-flow button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f8fbff;
  color: #0f172a;
  text-align: left;
  border: 1px solid #dbeafe;
}

.task-flow b {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
}

.task-flow strong {
  font-size: 14px;
}

.task-flow span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.feature-strip {
  display: grid;
  gap: 10px;
}

.feature-strip article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
}

.feature-strip .quick-icon {
  grid-row: span 2;
}

.feature-strip strong {
  color: #0b3d91;
}

.feature-strip p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.material-card .card-head,
.recipe-row .card-head,
.dish-card .card-head {
  border-bottom: 1px solid #edf4ff;
  padding-bottom: 10px;
}

.order-table-head {
  background: var(--accent-soft);
  color: #0b3d91;
}

.segment-tabs button.active,
.qty-control button {
  background: var(--accent);
  color: white;
}

.pill.ok {
  background: #dcfce7;
  color: #15803d;
}

.pill.warn {
  background: #fff7ed;
  color: #c2410c;
}

@media (min-width: 900px) {
  main {
    width: min(1180px, 100%);
  }

  .home-hero,
  .quick-grid,
  .home-panel,
  .feature-strip {
    max-width: 1180px;
  }

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

  .feature-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Final mockup controls */
.notify-btn::before {
  content: "🔔" !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  font-size: 24px;
  line-height: 1;
  transform: none !important;
  background: transparent !important;
}

.notify-btn::after {
  display: none !important;
}

.toolbar [data-template],
.toolbar [data-form-template],
.toolbar [data-pdf-export],
.toolbar [data-pdf-trigger],
.toolbar [data-image-trigger],
.toolbar [data-import-trigger] {
  display: none !important;
}

.toolbar #exportAllOrdersBtn,
.toolbar #exportReceivingBtn,
.toolbar #exportWasteBtn,
.toolbar #exportLossBtn,
.toolbar #exportPriceHistoryBtn {
  display: none !important;
}

.io-main-btn {
  background: #0b56d6;
  color: white;
}

.io-panel {
  width: min(420px, calc(100vw - 28px));
  padding: 16px;
}

.io-options {
  display: grid;
  gap: 10px;
}

.io-options button {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 13px 14px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #f8fbff;
  color: #0f172a;
  text-align: left;
}

.io-options b {
  color: #0b56d6;
  font-size: 16px;
}

.io-options span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.home-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

.metric-card i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf2ff;
}

.metric-card i::before {
  font-size: 22px;
}

.metric-card.cube i::before { content: "▧"; color: #0b56d6; }
.metric-card.alert i::before { content: "⚠"; color: #f59e0b; }
.metric-card.doc i::before { content: "▤"; color: #7c3aed; }
.metric-card.down i::before { content: "↓"; color: #16a34a; }
.metric-card.x i::before { content: "×"; color: #ef4444; }

.metric-card span {
  color: #172554;
  font-size: 14px;
  font-weight: 900;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.metric-card em {
  color: #172554;
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
}

.metric-card.alert { background: linear-gradient(135deg, #fff, #fff7ed); border-color: #fed7aa; }
.metric-card.doc { background: linear-gradient(135deg, #fff, #f5f3ff); border-color: #ddd6fe; }
.metric-card.down { background: linear-gradient(135deg, #fff, #f0fdf4); border-color: #bbf7d0; }
.metric-card.x { background: linear-gradient(135deg, #fff, #fef2f2); border-color: #fecaca; }

@media (min-width: 760px) {
  .app-header {
    padding-left: 28px;
    padding-right: 28px;
  }

  .tabs {
    top: 74px;
    width: min(980px, calc(100% - 48px));
    margin: 0 auto;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
  }

  main {
    padding-top: 20px;
  }

  .list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #mappingList,
  #inventoryList {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tabs {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .tab {
    min-height: 36px;
    padding: 0 3px;
    font-size: 12px;
  }

  .period-bar,
  .toolbar,
  .toolbar.split {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar {
    gap: 12px;
  }

  .search-box,
  .search-box.compact {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .toolbar button {
    width: 100%;
  }
}

/* Mobile app v2 */
:root {
  --bg: #eef6ff;
  --surface: #ffffff;
  --surface-2: #eff8f3;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #079455;
  --accent-2: #f59e0b;
  --danger: #ef4444;
  --ok: #10b981;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

body {
  background:
    radial-gradient(circle at 8% 2%, rgba(34, 197, 94, .16), transparent 24%),
    radial-gradient(circle at 95% 0%, rgba(59, 130, 246, .12), transparent 28%),
    linear-gradient(180deg, #eff7ff 0%, #f8fbff 42%, #f7fbf5 100%);
  font-family: "Segoe UI", Arial, sans-serif;
}

.app-header {
  min-height: 72px;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(255, 255, 255, .78);
  border-bottom: 0;
  backdrop-filter: blur(18px);
}

.app-header > div:first-of-type {
  flex: 1;
  text-align: center;
}

.app-header h1 {
  font-size: 17px;
  font-weight: 900;
}

.eyebrow {
  color: #087443;
  font-size: 11px;
}

.menu-btn {
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
}

.notify-btn {
  position: relative;
  background: transparent;
  color: var(--ink);
}

.notify-btn::before {
  content: "🔔";
  font-size: 21px;
}

.notify-btn span {
  position: absolute;
  top: 7px;
  right: 3px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 900;
}

main {
  width: min(520px, 100%);
  padding: 14px 14px 104px;
}

body[data-view="home"] .period-bar {
  display: none;
}

.tabs {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  top: auto;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(229, 231, 235, .9);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  overflow-x: auto;
}

.tab {
  flex: 1 0 auto;
  min-width: 58px;
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 18px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
}

.tab.active {
  background: #e8f7ee;
  color: #087443;
}

.tab-icon {
  display: block;
  font-size: 17px;
  line-height: 1;
}

.home-hero {
  position: relative;
  min-height: 154px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 22px 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 30%, rgba(255, 255, 255, .9), transparent 24%),
    linear-gradient(135deg, #ffffff 0%, #dff7ff 52%, #d7f7d8 100%);
  box-shadow: var(--shadow);
}

.home-hero span {
  color: #374151;
  font-size: 16px;
}

.home-hero h2 {
  margin: 8px 0 0;
  font-size: 27px;
  line-height: 1.1;
}

.hero-dish {
  width: 132px;
  height: 116px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, #fff7ed 0 28%, transparent 29%),
    radial-gradient(circle at 38% 38%, #ef4444 0 8%, transparent 9%),
    radial-gradient(circle at 61% 35%, #22c55e 0 8%, transparent 9%),
    radial-gradient(circle at 54% 58%, #f59e0b 0 10%, transparent 11%),
    radial-gradient(circle at 70% 58%, #ef4444 0 7%, transparent 8%),
    radial-gradient(circle at 48% 72%, #22c55e 0 9%, transparent 10%),
    linear-gradient(180deg, #f8fafc 0%, #e5e7eb 100%);
  box-shadow: inset 0 -12px 0 rgba(15, 23, 42, .08), 0 16px 28px rgba(34, 197, 94, .22);
}

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

.quick-grid button {
  min-height: 106px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  color: #111827;
  box-shadow: var(--shadow);
}

.quick-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.quick-icon::before {
  font-size: 23px;
}

.leaf { background: #dcfce7; color: #16a34a; }
.leaf::before { content: "✓"; }
.bowl { background: #ffedd5; color: #f97316; }
.bowl::before { content: "▰"; }
.recipe { background: #ede9fe; color: #7c3aed; }
.recipe::before { content: "☷"; }
.cart { background: #dbeafe; color: #2563eb; }
.cart::before { content: "▣"; }
.truck { background: #dcfce7; color: #16a34a; }
.truck::before { content: "▸"; }
.trash { background: #fee2e2; color: #dc2626; }
.trash::before { content: "⌫"; }
.box { background: #e0e7ff; color: #4f46e5; }
.box::before { content: "◇"; }
.chart { background: #ffedd5; color: #f97316; }
.chart::before { content: "▥"; }
.gear { background: #f1f5f9; color: #475569; }
.gear::before { content: "⚙"; }

.home-panel,
.period-bar,
.card,
.summary-grid article {
  border: 1px solid rgba(229, 231, 235, .92);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.home-panel {
  padding: 14px;
  margin-bottom: 14px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 16px;
}

.section-head button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: #2563eb;
}

.home-summary article:nth-child(1) { background: linear-gradient(135deg, #f0fdfa, #ffffff); }
.home-summary article:nth-child(2) { background: linear-gradient(135deg, #f0fdf4, #ffffff); }
.home-summary article:nth-child(3) { background: linear-gradient(135deg, #eef2ff, #ffffff); }
.home-summary article:nth-child(4) { background: linear-gradient(135deg, #fff7ed, #ffffff); }

.top-list {
  display: grid;
  gap: 12px;
}

.top-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-bottom: 13px;
}

.top-row strong,
.top-row b,
.top-row span {
  position: relative;
  z-index: 1;
}

.top-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-row i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
}

.top-row i::before {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: #10b981;
}

.toolbar,
.toolbar.split,
.period-bar {
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.toolbar {
  flex-wrap: wrap;
}

.toolbar button,
.mini-btn,
.dialog-actions button {
  border-radius: 14px;
}

input,
select {
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
}

.card {
  padding: 14px;
}

.card-head {
  align-items: center;
}

.dish-card .card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
}

.dish-thumb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #f97316 0 20%, transparent 21%),
    radial-gradient(circle at 66% 40%, #22c55e 0 16%, transparent 17%),
    radial-gradient(circle at 48% 68%, #ef4444 0 15%, transparent 16%),
    #fff7ed;
  color: #7c2d12;
  font-weight: 900;
  box-shadow: inset 0 -6px 0 rgba(15, 23, 42, .06);
}

.title {
  font-size: 17px;
}

.qty-control {
  grid-template-columns: 36px 56px 36px;
  padding: 4px;
  border-radius: 14px;
  background: #f1f5f9;
}

.qty-control button {
  min-height: 34px;
  border-radius: 11px;
  background: #dcfce7;
  color: #087443;
}

.qty-control input {
  min-height: 34px;
  border: 0;
  text-align: center;
  background: white;
}

.money,
.card-head strong {
  color: #111827;
  font-size: 16px;
}

.pill {
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
}

.pill.ok {
  background: #dcfce7;
  color: #047857;
}

.pill.warn {
  background: #fff7ed;
  color: #b45309;
}

.empty.compact-empty {
  padding: 16px 10px;
}

@media (min-width: 760px) {
  .tabs {
    position: sticky;
    top: 74px;
    left: auto;
    right: auto;
    bottom: auto;
    width: min(980px, calc(100% - 48px));
    border-radius: 0 0 18px 18px;
  }

  main {
    width: min(980px, 100%);
    padding-bottom: 36px;
  }

  .home-hero,
  .quick-grid,
  .home-panel {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-actions {
    gap: 2px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .period-bar,
  .toolbar,
  .toolbar.split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receive-controls {
    grid-template-columns: minmax(74px, 1fr) minmax(94px, 1fr);
  }
}

/* Mockup alignment pass */
.notify-btn::before {
  content: "";
  width: 18px;
  height: 20px;
  border: 2px solid #111827;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom: 0;
  transform: translateY(2px);
}

.notify-btn::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 9px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #111827;
}

.quick-icon::before {
  content: "";
  width: 21px;
  height: 21px;
  border-radius: 6px;
  border: 3px solid currentColor;
}

.leaf::before { border-radius: 50% 4px 50% 4px; transform: rotate(-25deg); }
.bowl::before { border-radius: 4px 4px 12px 12px; border-top: 0; }
.recipe::before { border-radius: 4px; box-shadow: inset 0 5px 0 currentColor; }
.cart::before { border-radius: 4px; border-bottom-width: 5px; }
.truck::before { border-radius: 4px; box-shadow: 10px 4px 0 -3px currentColor; }
.trash::before { border-radius: 3px; border-top-width: 5px; }
.box::before { transform: rotate(45deg); border-radius: 3px; }
.chart::before { border-width: 0 0 4px 4px; border-radius: 0; box-shadow: 7px -5px 0 -2px currentColor, 14px -10px 0 -2px currentColor; }
.gear::before { border-radius: 50%; box-shadow: 0 0 0 5px rgba(71, 85, 105, .16); }

.dish-thumb::before,
.material-thumb::before {
  content: attr(data-initial);
}

.material-thumb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fecaca 0 18%, transparent 19%),
    radial-gradient(circle at 65% 45%, #bbf7d0 0 15%, transparent 16%),
    radial-gradient(circle at 52% 70%, #fed7aa 0 16%, transparent 17%),
    #fff7ed;
  color: #14532d;
  font-weight: 900;
  box-shadow: inset 0 -5px 0 rgba(15, 23, 42, .06);
}

.material-thumb.small {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.dish-thumb.large {
  width: 76px;
  height: 76px;
}

.recipe-cover,
.inventory-summary,
.order-table-card {
  border: 1px solid rgba(229, 231, 235, .92);
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.recipe-cover {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.recipe-cover h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.recipe-cover p {
  margin: 0;
  color: var(--muted);
}

.recipe-row .card-head,
.material-card .card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
}

.segment-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}

.segment-tabs button {
  min-height: 36px;
  border-radius: 12px;
  background: transparent;
  color: #111827;
  font-size: 13px;
}

.segment-tabs button.active {
  background: var(--accent);
  color: white;
}

.order-table-card {
  overflow: hidden;
  margin-bottom: 12px;
}

.order-table-head,
.order-table-row {
  display: grid;
  grid-template-columns: minmax(126px, 1.55fr) minmax(62px, .7fr) minmax(48px, .55fr) minmax(86px, .9fr);
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f7;
}

.order-table-head {
  background: #f8fafc;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.order-table-row {
  font-size: 13px;
}

.order-table-row input {
  min-height: 32px;
  padding: 0 4px;
  text-align: center;
  border: 0;
  background: #f8fafc;
}

.order-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
}

.order-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 15px;
}

.order-total-row strong {
  font-size: 19px;
}

.primary-wide {
  width: 100%;
  min-height: 52px;
  margin: 2px 0 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #0ba360, #07884d);
  box-shadow: 0 14px 28px rgba(7, 136, 77, .25);
}

.supplier-card {
  margin-top: 12px;
}

.inventory-summary {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 14px;
  text-align: center;
}

.inventory-summary > span {
  color: var(--muted);
  font-weight: 800;
}

.inventory-summary > strong {
  font-size: 25px;
}

.donut {
  position: relative;
  width: 134px;
  height: 134px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#10b981 0 58%, #f59e0b 58% 78%, #ef4444 78% 100%);
}

.donut::before {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: white;
}

.donut b,
.donut small {
  position: relative;
  z-index: 1;
  display: block;
  grid-column: 1;
  grid-row: 1;
}

.donut b {
  margin-top: -10px;
  font-size: 28px;
}

.donut small {
  margin-top: 32px;
  color: var(--muted);
  font-weight: 800;
}

.inventory-summary ul {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 18px;
  list-style: none;
  text-align: left;
}

.inventory-summary li {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.inventory-summary li i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ok-dot { background: #10b981; }
.low-dot { background: #f59e0b; }
.empty-dot { background: #ef4444; }

.stock-warning {
  display: grid;
  gap: 10px;
}

.stock-warning-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.stock-warning-row span:last-child {
  color: #ef4444;
  font-size: 12px;
  font-weight: 900;
}

.solution-hero,
.sync-card,
.architecture-card,
.solution-stack article,
.solution-grid article {
  border: 1px solid rgba(229, 231, 235, .92);
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.solution-hero {
  padding: 20px;
  margin-bottom: 14px;
  background:
    radial-gradient(circle at 88% 22%, rgba(16, 185, 129, .18), transparent 24%),
    linear-gradient(135deg, #ffffff, #eef6ff);
}

.solution-hero span {
  color: #087443;
  font-weight: 900;
}

.solution-hero h2 {
  margin: 8px 0;
  font-size: 24px;
}

.solution-hero p,
.solution-stack p,
.architecture-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.solution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.solution-grid article {
  padding: 14px;
}

.solution-grid strong {
  display: block;
  font-size: 26px;
}

.solution-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.sync-card h2,
.solution-stack h2,
.architecture-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.sync-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

#solutionOnlineBadge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-weight: 900;
}

#solutionOnlineBadge.offline {
  background: #fee2e2;
  color: #b91c1c;
}

.solution-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.solution-stack article {
  padding: 14px;
}

.solution-stack button {
  width: 100%;
  margin-top: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #0ba360, #07884d);
}

.architecture-card {
  padding: 14px;
}

.arch-flow {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.arch-flow span,
.arch-flow i {
  display: block;
  border-radius: 16px;
  padding: 11px 12px;
  text-align: center;
  font-style: normal;
  font-weight: 900;
}

.arch-flow span {
  background: #f8fafc;
  color: #111827;
}

.arch-flow i {
  background: #e8f7ee;
  color: #087443;
}

@media (max-width: 640px) {
  body:not([data-view="home"]) .app-header .eyebrow {
    display: none;
  }

  body:not([data-view="home"]) .app-header h1 {
    font-size: 16px;
  }

  .menu-btn {
    font-size: 34px;
  }

  .tabs .tab:nth-child(n+6) {
    display: none;
  }

  .tabs {
    left: 20px;
    right: 20px;
    padding: 10px 16px;
  }

  .tab {
    min-width: 54px;
  }

  .toolbar,
  .toolbar.split {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .toolbar .search-box:first-child {
    flex: 1 0 100%;
  }

  .toolbar .search-box,
  .toolbar .search-box.compact {
    flex: 0 0 auto;
    min-width: 128px;
  }

  .toolbar button {
    width: auto;
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 999px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .search-box span {
    display: none;
  }

  input,
  select {
    min-height: 42px;
    border-radius: 14px;
  }

  .summary-grid:not(.home-summary) {
    display: none;
  }

  .actions-row {
    margin-top: 8px;
  }

  .actions-row .danger-btn,
  .actions-row .secondary-btn {
    background: #f8fafc;
  }

  .supplier-card .line-items {
    display: none;
  }

  .supplier-card .actions-row {
    justify-content: stretch;
  }

  .supplier-card .actions-row button {
    width: 100%;
  }
}

/* Last-mile overrides */
.notify-btn::before {
  content: "🔔" !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  font-size: 24px !important;
  line-height: 1 !important;
  transform: none !important;
  background: transparent !important;
}

.notify-btn::after {
  display: none !important;
}

.toolbar [data-template],
.toolbar [data-form-template],
.toolbar [data-pdf-export],
.toolbar [data-pdf-trigger],
.toolbar [data-image-trigger],
.toolbar [data-import-trigger],
.toolbar #exportAllOrdersBtn,
.toolbar #exportReceivingBtn,
.toolbar #exportWasteBtn,
.toolbar #exportLossBtn,
.toolbar #exportPriceHistoryBtn {
  display: none !important;
}
