/* ==========================================================================
   Logan'sCafe owner dashboard: a concept by MadeByMyst.
   The same café, seen from behind the counter: the website's cream,
   espresso and amber, its type and its buttons, with quiet cards for the
   numbers Logan checks every day.
   Written mobile-first. Larger screens are added with min-width queries.
   ========================================================================== */

/* DESIGN TOKENS */

:root {
  /* Colours (the same as the café's website) */
  --cream: #f5efe6;
  --cream-2: #efe5d6;
  --cream-3: #fbf7f1;
  --paper: #fffdf9;
  --espresso: #40220b;
  --espresso-2: #2a1506;
  --amber: #d9b688;
  --amber-dark: #a8814f;
  --text: #2a1506;
  --text-muted: rgba(42, 21, 6, 0.72);
  --on-dark: #f5efe6;
  --on-dark-muted: rgba(245, 239, 230, 0.75);
  --line: rgba(64, 34, 11, 0.14);
  --line-strong: rgba(64, 34, 11, 0.26);
  --line-dark: rgba(245, 239, 230, 0.16);

  /* Status: always shown with a word and an icon, never colour alone */
  --good: #2f7a43;
  --warning: #d39a2c;
  --warning-text: #8a5a06;
  --bad: #a8442e;

  /* Chart colours, checked for colour-blind separation on the card colour */
  --chart-coffee: #8c4a1a;
  --chart-cold: #1d7aa5;
  --chart-pastries: #bf8b20;
  --chart-past: #d8ccbd;
  --chart-grid: rgba(64, 34, 11, 0.09);
  --chart-axis: rgba(64, 34, 11, 0.3);

  /* Quiet to busy, for the heatmap */
  --heat-0: #f2e5d1;
  --heat-1: #e5c7a5;
  --heat-2: #d8a879;
  --heat-3: #c98a4b;
  --heat-4: #9d6534;
  --heat-5: #72421e;
  --heat-6: #4a220a;

  /* Type */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", sans-serif;
  --font-script: "Monsieur La Doulaise", cursive;

  /* Shape & layout */
  --radius: 12px;
  --gutter: 20px;
  --sidebar-w: 256px;
  --bar-h: 68px;

  /* Motion: one long, soft ease-out */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* RESET & BASE */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

[hidden] {
  display: none !important;
}

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

body {
  background-color: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--amber);
  color: var(--espresso-2);
}

:focus-visible {
  outline: 2px solid var(--amber-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* TYPOGRAPHY */

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 2.8rem);
}

h1:focus {
  outline: none;
}

h2 {
  font-size: 1.3rem;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

/* HELPERS */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--amber);
  color: var(--espresso-2);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.nowrap {
  white-space: nowrap;
}

.empty {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.noscript {
  margin-bottom: 24px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--cream-2);
}

/* BUTTONS */

/* The café's own button (amber fills in from the left), in espresso for
   light backgrounds */
.btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 11px 24px;
  overflow: hidden;
  border: 1.5px solid var(--espresso);
  background-color: transparent;
  color: var(--espresso);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before,
.btn-small::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--espresso);
  transform: translateX(-101%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover::before,
.btn-small:hover::before {
  transform: translateX(0);
}

.btn:hover {
  color: var(--cream);
  box-shadow: 0 6px 24px rgba(64, 34, 11, 0.2);
}

/* A smaller one for rows of things (orders, stock, reviews) */
.btn-small {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 5px 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.35s ease;
}

.btn-small:hover,
.btn-small.is-solid {
  border-color: var(--espresso);
  color: var(--cream);
}

.btn-small.is-solid {
  background: var(--espresso);
}

/* A quiet link-style button */
.text-btn {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(168, 129, 79, 0.5);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.text-btn:hover {
  color: var(--text);
  text-decoration-color: var(--amber-dark);
}

/* Two or three choices side by side */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream-3);
}

.segmented button {
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.35s var(--ease-out),
    color 0.35s var(--ease-out);
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed="true"] {
  background: var(--espresso);
  color: var(--cream);
}

/* FORM FIELDS */

.field {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.3s ease;
}

.field:hover {
  border-color: var(--amber-dark);
}

.field:focus-visible {
  outline-offset: 1px;
}

.field::placeholder {
  color: rgba(42, 21, 6, 0.5);
}

/* On / off switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 38px;
  height: 22px;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #d6c9b8;
  transition: background-color 0.35s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(42, 21, 6, 0.3);
  transition: translate 0.45s var(--ease-out);
}

.switch input:checked + .switch-track {
  background: var(--good);
}

.switch input:checked + .switch-track::after {
  translate: 16px 0;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--amber-dark);
  outline-offset: 2px;
}

.switch input:checked ~ .switch-off,
.switch input:not(:checked) ~ .switch-on {
  display: none;
}

.switch-off {
  color: var(--bad);
  font-weight: 600;
}

/* LAYOUT
   Phones: a bar along the top with a menu button.
   From 1000px: a sidebar on the left. */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--espresso-2);
  color: var(--on-dark);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar-h);
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: auto;
}

.brand span {
  font-family: var(--font-script);
  font-size: 2rem;
  line-height: 1;
  color: var(--amber);
}

/* Menu button (the same as the website's) */
.menu-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle .bar {
  position: absolute;
  right: 12px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--cream);
  transition:
    translate 0.5s var(--ease-out),
    rotate 0.5s var(--ease-out),
    opacity 0.3s ease;
}

.menu-toggle .bar:nth-child(2) {
  top: 14px;
}

.menu-toggle .bar:nth-child(3) {
  top: 20px;
}

.menu-toggle .bar:nth-child(4) {
  top: 26px;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
  translate: 0 6px;
  rotate: 45deg;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(4) {
  translate: 0 -6px;
  rotate: -45deg;
}

/* The open menu fills the screen below the bar */
.sidebar-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bar-h));
  height: calc(100dvh - var(--bar-h));
  padding: 8px var(--gutter) 28px;
  overflow-y: auto;
  background-color: var(--espresso-2);
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.4s ease,
    visibility 0s linear 0.4s;
}

.menu-is-open .sidebar-panel {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

body.menu-open {
  overflow: hidden;
}

.side-nav {
  position: relative;
  display: grid;
}

.side-nav a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-dark);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-decoration: none;
}

.side-nav a[aria-current="page"] {
  color: var(--amber);
}

.nav-count {
  min-width: 26px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(217, 182, 136, 0.18);
  color: var(--amber);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.nav-marker {
  display: none;
}

/* Today's special, like the card on the website's hero */
.side-special {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 12px 16px 12px 12px;
  border: 1px solid rgba(217, 182, 136, 0.3);
  border-radius: 16px;
  background-color: rgba(245, 239, 230, 0.04);
  text-decoration: none;
  transition:
    border-color 0.35s ease,
    background-color 0.35s ease;
}

.side-special:hover {
  border-color: rgba(217, 182, 136, 0.6);
  background-color: rgba(245, 239, 230, 0.07);
}

.side-special img {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
}

.side-special > span {
  display: grid;
}

.special-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.special-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--cream);
}

.special-price {
  font-size: 0.9rem;
  color: var(--on-dark-muted);
}

.side-foot {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--on-dark-muted);
}

.side-owner strong {
  color: var(--cream);
}

.side-link {
  width: fit-content;
  color: var(--on-dark-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.side-link:hover {
  color: var(--amber);
}

.out-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Main area */
.main {
  min-width: 0;
  padding: 0 var(--gutter) 32px;
}

.main:focus {
  outline: none;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  padding-block: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.topbar-date {
  color: var(--text-muted);
}

/* "Open now · until 9pm", set by script.js (the website's style) */
.open-now {
  font-weight: 600;
}

.open-now.is-open {
  color: var(--good);
}

.open-now.is-closed {
  color: var(--bad);
}

.view-head {
  margin-bottom: 24px;
}

.view-head p {
  max-width: 40em;
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.main-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.main-foot a {
  color: var(--text);
  text-decoration-color: rgba(168, 129, 79, 0.5);
  text-underline-offset: 4px;
}

.main-foot a:hover {
  color: var(--amber-dark);
}

/* Each page fades up in steps when it opens */
.js .view > * {
  animation: fade-up 0.9s var(--ease-out) backwards;
}

.view > :nth-child(2) {
  animation-delay: 0.06s;
}
.view > :nth-child(3) {
  animation-delay: 0.12s;
}
.view > :nth-child(4) {
  animation-delay: 0.18s;
}
.view > :nth-child(n + 5) {
  animation-delay: 0.24s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    translate: 0 18px;
  }
}

/* CARDS & GRIDS */

.card {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--cream-3);
}

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

.card-sub {
  margin-top: 2px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.card-kicker {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--amber-dark);
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.grid-gap {
  margin-top: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.filters-note {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.search {
  flex: 1 1 240px;
  max-width: 360px;
}

/* Simple two-sided rows: a name on the left, details on the right */
.plain-list {
  display: grid;
  padding: 0;
  list-style: none;
}

.plain-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list > li:first-child {
  padding-top: 0;
}

.plain-list > li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list-title {
  font-weight: 600;
}

.list-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.list-side {
  text-align: right;
  font-size: 0.92rem;
  white-space: nowrap;
}

/* STAT TILES */

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

.stat {
  padding: 18px 18px 20px;
}

.stat-label {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Big numbers stay in the body font, with ordinary (not tabular) figures */
.stat-value {
  margin-top: 4px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.stat-delta,
.stat-note {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.stat-delta.is-up {
  color: var(--good);
}

.stat-delta.is-down {
  color: var(--bad);
}

/* CHARTS */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: -4px 0 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--key);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-body);
}

.chart-svg:focus-visible {
  outline-offset: 6px;
  border-radius: 8px;
}

.chart-grid {
  stroke: var(--chart-grid);
}

.chart-baseline {
  stroke: var(--chart-axis);
}

.chart-tick {
  fill: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-value {
  fill: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.chart-hit {
  fill: transparent;
}

.chart-wash {
  fill: rgba(64, 34, 11, 0.06);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.chart-wash.is-visible {
  opacity: 1;
}

/* Columns grow up from the baseline the first time they're drawn */
.chart-bar.is-growing {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: grow-up 1.1s var(--ease-out) backwards;
}

@keyframes grow-up {
  from {
    transform: scaleY(0);
  }
}

.chart-table {
  max-height: 340px;
}

/* The tooltip */
.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  min-width: 150px;
  padding: 10px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 40px -16px rgba(42, 21, 6, 0.35);
  font-size: 0.88rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tooltip.is-visible {
  opacity: 1;
}

.tooltip-title {
  margin-bottom: 4px;
  color: var(--text-muted);
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tooltip-row strong {
  font-size: 0.98rem;
}

.tooltip-row span:not(.tooltip-key) {
  color: var(--text-muted);
}

.tooltip-key {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--key);
}

/* Ranked bars: a name and number, with a thin bar underneath */
.bar-list {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.bar-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: baseline;
}

.bar-name {
  font-weight: 500;
}

.bar-value {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.bar-fill {
  grid-column: 1 / -1;
  width: calc(var(--size) * 100%);
  height: 8px;
  border-radius: 0 4px 4px 0;
  background: var(--chart-coffee);
  transform-origin: left;
  transition: width 0.9s var(--ease-out);
  animation: grow-across 1.1s var(--ease-out) 0.15s backwards;
}

@keyframes grow-across {
  from {
    transform: scaleX(0);
  }
}

/* Part of a whole */
.stack {
  display: flex;
  gap: 2px;
  height: 40px;
  overflow: hidden;
  border-radius: 6px;
}

.stack-part {
  display: grid;
  place-items: center;
  flex-basis: 0;
  min-width: 0;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  transform-origin: left;
  animation: grow-across 1.1s var(--ease-out) backwards;
}

/* The gold is light, so its label is dark */
.part-pastries {
  color: var(--espresso-2);
}

.stack-legend {
  display: grid;
  padding: 0;
  margin-top: 18px;
  list-style: none;
}

.stack-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto 3.2em;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.stack-legend li:last-child {
  border-bottom: 0;
}

.stack-legend strong,
.stack-share {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stack-share {
  color: var(--text-muted);
}

/* Heatmap */
.heatmap {
  width: 100%;
  min-width: 340px;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.heatmap th {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.heatmap thead th {
  padding-bottom: 4px;
  text-align: left;
}

.heatmap thead td,
.heatmap tbody th {
  width: 40px;
  text-align: left;
}

.heat {
  height: 30px;
  border-radius: 4px;
  transition: box-shadow 0.2s ease;
}

.heat:hover {
  box-shadow: 0 0 0 2px var(--espresso);
}

.heat.is-closed {
  box-shadow: inset 0 0 0 1px var(--line);
}

.heat-0 { background: var(--heat-0); }
.heat-1 { background: var(--heat-1); }
.heat-2 { background: var(--heat-2); }
.heat-3 { background: var(--heat-3); }
.heat-4 { background: var(--heat-4); }
.heat-5 { background: var(--heat-5); }
.heat-6 { background: var(--heat-6); }

.heat-scale {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.heat-scale i {
  width: 22px;
  height: 10px;
  border-radius: 2px;
}

.heat-scale span:first-child {
  margin-right: 6px;
}

.heat-scale span:last-child {
  margin-left: 6px;
}

/* TABLES */

/* position: relative keeps screen-reader-only text inside the scroll box */
.table-wrap,
.heatmap-wrap {
  position: relative;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 0;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 0;
}

.data-table thead th {
  padding-top: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tbody th {
  font-weight: 500;
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.best-table .legend-swatch {
  margin-right: 10px;
}

.best-table th,
.best-table td {
  padding-block: 9px;
}

/* Small headings inside a card */
.sub-heading {
  margin: 28px 0 6px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.ratio-list .meter {
  margin: 6px 0 4px;
}

.ratio-list > li {
  display: block;
}

.ratio-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ratio-head strong {
  font-variant-numeric: tabular-nums;
}

/* TODAY */

.queue {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber-dark);
  border-radius: 8px;
  background: var(--paper);
}

.queue-item.is-arriving {
  animation: arrive 0.9s var(--ease-out);
}

@keyframes arrive {
  from {
    opacity: 0;
    translate: 0 -10px;
  }
}

.queue-main {
  flex: 1;
  min-width: 0;
}

.queue-title span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.queue-items {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.queue-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.queue-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* The status word wears the status colour; the word itself says it */
.status-word {
  font-weight: 600;
  color: var(--text);
}

.status-new .status-word {
  color: var(--espresso);
}

.status-making .status-word {
  color: var(--warning-text);
}

.status-ready .status-word {
  color: var(--good);
}

.status-collected .status-word {
  font-weight: 400;
  color: var(--text-muted);
}

.queue-item.status-new {
  border-left-color: var(--espresso);
}

.queue-item.status-making {
  border-left-color: var(--warning);
}

.queue-item.status-ready {
  border-left-color: var(--good);
}

.shift-state {
  color: var(--text-muted);
}

.shift-list .is-on .shift-state {
  font-weight: 600;
  color: var(--good);
}

.shift-list .is-done {
  opacity: 0.6;
}

/* Status labels: icon + word */
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-label svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "Plenty" stays quiet so the things to order stand out */
.status-ok {
  font-weight: 500;
  color: var(--text-muted);
}

.status-ok svg {
  color: var(--good);
}

.status-low {
  color: var(--warning-text);
}

.status-critical {
  color: var(--bad);
}

.status-ordered {
  color: var(--text-muted);
}

/* The latest review, set like the quote on the café's website */
.latest-review {
  margin-top: 16px;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
}

.latest-review blockquote p {
  max-width: 34em;
  margin: 10px auto 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-style: italic;
  line-height: 1.4;
}

.latest-review figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 16px;
  color: var(--text-muted);
}

.stars {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--line-strong);
}

.stars span {
  color: var(--amber-dark);
}

/* ORDERS */

.orders-table td:nth-child(3) {
  min-width: 220px;
}

.orders-table .status-cell {
  white-space: nowrap;
}

.orders-table .btn-small {
  margin-left: 10px;
  padding-block: 2px;
  font-size: 0.85rem;
}

.orders-table tr.status-collected td {
  color: var(--text-muted);
}

.orders-table tr.status-collected strong {
  color: var(--text);
}

.more-btn {
  margin-top: 20px;
}

/* MENU */

.menu-grid {
  display: grid;
  gap: 16px;
}

.card.menu-card {
  padding: 0;
  overflow: hidden;
}

.menu-photo {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.menu-card-body {
  padding: 20px 22px 12px;
}

.menu-card h2 {
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--espresso);
  font-size: 1.5rem;
}

.menu-items {
  padding: 0;
  list-style: none;
}

.menu-item {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.4s ease;
}

.menu-item:last-child {
  border-bottom: 0;
}

.menu-item-name {
  font-weight: 600;
}

.menu-item-desc {
  font-size: 0.93rem;
  color: var(--text-muted);
}

.menu-item-sold {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--amber-dark);
}

.special-note {
  display: none;
  color: var(--text);
}

/* Today's special gets the soft highlight it has on the website */
.menu-item.is-special {
  margin-inline: -12px;
  padding-inline: 12px;
  border-radius: 8px;
  border-bottom-color: transparent;
  background-color: var(--cream-2);
}

.is-special .special-note {
  display: inline;
}

.menu-item.is-sold-out .menu-item-text {
  opacity: 0.55;
}

.menu-item.is-sold-out .menu-item-name {
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.menu-item-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.price-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.price-field .field {
  width: 86px;
  padding: 6px 8px;
  font-variant-numeric: tabular-nums;
}

.special-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
}

.special-pick input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--espresso);
  cursor: pointer;
}

.menu-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 24px;
  color: var(--text-muted);
}

.menu-foot p {
  max-width: 34em;
}

/* STOCK */

.stock-grid {
  display: grid;
  gap: 16px;
}

.stock-list {
  display: grid;
  padding: 0;
  list-style: none;
}

.stock-item {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.stock-item:first-child {
  padding-top: 0;
}

.stock-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stock-top,
.stock-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
}

.stock-top {
  align-items: baseline;
  margin-bottom: -8px;
}

/* Fill level: the track is a pale step of the same brown */
.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #ebdfcf;
}

.meter span {
  display: block;
  width: calc(var(--fill) * 100%);
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--chart-coffee);
  transform-origin: left;
  animation: grow-across 1.1s var(--ease-out) 0.2s backwards;
}

.is-low .meter span {
  background: var(--warning);
}

.is-critical .meter span {
  background: var(--bad);
}

.is-ordered .meter span {
  background: var(--chart-past);
}

.stock-ordered {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ROTA */

.rota-table {
  min-width: 760px;
}

.rota-table th,
.rota-table td {
  padding-inline: 10px;
}

.rota-table tbody th {
  display: grid;
  min-width: 130px;
}

.rota-table td {
  font-size: 0.9rem;
  line-height: 1.45;
}

.rota-table .is-off {
  color: rgba(42, 21, 6, 0.45);
}

/* Today's column */
.rota-table .is-today {
  background: var(--cream-2);
}

.rota-table thead .is-today {
  border-radius: 8px 8px 0 0;
  color: var(--text);
}

.rota-table tfoot th,
.rota-table tfoot td {
  border-bottom: 0;
  font-weight: 600;
}

.rota-table tfoot .is-today {
  border-radius: 0 0 8px 8px;
}

.rota-table tbody tr:last-child > * {
  border-bottom: 1px solid var(--line-strong);
}

/* REVIEWS */

.reviews-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.rating-figure {
  margin-top: 10px;
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.rating-bars {
  margin-top: 22px;
}

.review-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.review {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.review.needs-reply {
  border-left: 3px solid var(--amber-dark);
}

.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}

.review-meta {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.review-meta strong {
  color: var(--text);
}

.review-text {
  max-width: 40em;
  font-size: 1.02rem;
}

.reply {
  display: grid;
  gap: 4px;
  justify-items: start;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--cream-2);
  font-size: 0.95rem;
}

.reply-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--amber-dark);
}

.reply-form {
  display: grid;
  gap: 10px;
  width: 100%;
}

.reply-form textarea {
  resize: vertical;
  min-height: 84px;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* TOAST */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--espresso-2);
  color: var(--cream);
  box-shadow: 0 18px 40px -18px rgba(42, 21, 6, 0.6);
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0;
  translate: -50% 16px;
  transition:
    opacity 0.4s ease,
    translate 0.6s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  translate: -50% 0;
}

/* LARGER SCREENS */

@media (min-width: 620px) {
  .heatmap thead .is-minor {
    font-size: 0.8rem;
  }
}

@media (max-width: 619px) {
  /* Every other hour label on small screens */
  .heatmap thead .is-minor {
    color: transparent;
  }
}

@media (min-width: 760px) {
  :root {
    --gutter: 28px;
  }

  .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .card {
    padding: 24px 26px 26px;
  }

  .stat {
    padding: 20px 22px 22px;
  }

  .menu-item {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .reviews-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .rating-card {
    position: sticky;
    top: 24px;
  }
}

/* The sidebar */
@media (min-width: 1000px) {
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 16px 22px;
    overflow-y: auto;
  }

  .sidebar-top {
    height: auto;
    padding: 0 10px 28px;
  }

  .menu-toggle {
    display: none;
  }

  .sidebar-panel {
    position: static;
    flex: 1;
    height: auto;
    padding: 0;
    overflow: visible;
    background: none;
    visibility: visible;
    opacity: 1;
  }

  .side-nav {
    gap: 2px;
  }

  .side-nav a {
    padding: 10px 14px;
    border-bottom: 0;
    border-radius: 8px;
    color: var(--on-dark-muted);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
  }

  .side-nav a:hover,
  .side-nav a[aria-current="page"] {
    color: var(--cream);
  }

  /* The soft highlight that glides between pages */
  .nav-marker {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: block;
    border-radius: 8px;
    background: rgba(217, 182, 136, 0.13);
    box-shadow: inset 3px 0 0 var(--amber);
  }

  .nav-marker.is-ready {
    transition:
      translate 0.6s var(--ease-out),
      height 0.6s var(--ease-out);
  }

  .side-special {
    margin-top: auto;
  }

  .side-foot {
    padding-inline: 4px;
  }

  .main {
    padding: 0 clamp(28px, 3.5vw, 48px) 36px;
  }

  .topbar {
    padding-block: 22px 18px;
    margin-bottom: 30px;
  }
}

@media (min-width: 1280px) {
  .grid-today {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }

  /* A busy queue scrolls inside its card, so the chart beside it keeps its size */
  .queue {
    max-height: 412px;
    padding-right: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (min-width: 1440px) {
  .main {
    max-width: 1400px;
  }

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

/* SMALL PHONES */

@media (max-width: 420px) {
  :root {
    --gutter: 16px;
  }

  .brand span {
    font-size: 1.8rem;
  }

  .card {
    padding: 18px 16px 20px;
  }

  .stat {
    padding: 14px 14px 16px;
  }

  .card-head {
    flex-wrap: wrap;
  }
}

/* RESPECT REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
