/* What the cloud's web pages share (the owner view and the console): the
   counter's colours and fonts (apps/pos/lib/app/theme), a rail of pages on
   a computer and a tab bar on a phone, panels, tables and sign-in. Each
   service adds its own sheet after this one. Nothing loads from
   elsewhere. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/web/fonts/BricolageGrotesque-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/static/web/fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --canvas: #f2eadb;
  --paper: #fffbf3;
  --ink: #1a2a1f;
  --ink-soft: #5c695f;
  --ink-faint: #8c968e;
  --line: #e2d6bf;
  --line-strong: #c9bb9e;
  --green: #17452c;
  --green-2: #1f5b3a;
  --cream: #f6efdf;
  --cream-soft: rgba(246, 239, 223, 0.68);
  --marigold: #f4bf2a;
  --chilli: #c2361e;
  --chilli-wash: #fcebe7;
  --mark: #ff8a6e;
  --amber: #b7791f;
  --amber-wash: #fff6e2;
  --ok: #2f7d4f;
  --ok-wash: #e4f0e7;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 var(--text);
  font-variant-numeric: tabular-nums;
}

a { color: var(--green); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
}

.defs { position: absolute; width: 0; height: 0; }

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

/* The rail: who the pages are about, then the pages. */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 16px 22px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand img { display: block; height: 58px; width: auto; max-width: 180px; object-fit: contain; }
.brand strong { display: block; margin-top: 12px; font: 650 17px/1.2 var(--display); }
.brand span { color: var(--ink-soft); font-size: 13px; }

.pages { display: flex; flex-direction: column; gap: 2px; }

.pages a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}

.pages a:hover { color: var(--ink); background: rgba(255, 251, 243, 0.6); }
.pages a[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.pages a[aria-current="page"] svg { color: var(--green); }
.pages svg { width: 20px; height: 20px; flex: none; }
.pages .label-short { display: none; }

.rail-foot { margin-top: auto; color: var(--ink-soft); font-size: 13px; }
.rail-foot span { display: block; overflow-wrap: anywhere; }

.rail-foot button {
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 600 14px var(--text);
  cursor: pointer;
}

main { padding: 26px 40px 72px; max-width: 1200px; width: 100%; }

/* The line above every page: what you are reading. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-title {
  margin: 0;
  font: 700 28px/1.15 var(--display);
  letter-spacing: -0.01em;
}

.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.spaced { margin-top: 14px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px 14px;
}

.panel > h2 { margin: 0 0 4px; font: 650 19px/1.3 var(--display); }
.lede { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }

/* Tables: figures right-aligned, one rule per row. */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }

th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 10px 12px 8px 0;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.soft { color: var(--ink-soft); }
td .note { display: block; color: var(--ink-soft); font-size: 12.5px; white-space: normal; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chips a {
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  background: var(--paper);
}

.chips a[aria-current="true"] { background: var(--green); border-color: var(--green); color: var(--cream); }

.tag { display: inline-block; padding: 1px 8px; margin-left: 6px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 1px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 6px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.status.ok::before { background: var(--ok); }
.status.wait::before { background: var(--amber); }
.status.off::before { background: var(--chilli); }

/* Sign in. */
.signin main.narrow { max-width: 420px; margin: 0 auto; padding: 56px 16px; }
.signin h1 { margin: 0; font: 700 34px/1.1 var(--display); }
.signin .soft { margin: 6px 0 20px; }
.signin .panel { padding: 22px; }
.signin label { display: block; margin: 12px 0 4px; color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.signin label:first-child { margin-top: 0; }

.signin input {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}

.signin button {
  margin-top: 18px;
  padding: 11px 20px;
  font: 600 15px var(--text);
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: var(--cream);
  cursor: pointer;
}

.problem { color: var(--chilli); font-weight: 600; margin: 12px 0 0; }

/* Phone: the rail becomes a header and a tab bar at the bottom. */
.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }

  .rail {
    position: static;
    height: auto;
    padding: 16px 16px 4px;
    border-right: 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .brand div { min-width: 0; }
  .brand span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand img { height: 40px; max-width: 110px; }
  .brand strong { margin: 0; font-size: 15px; }
  .rail .pages { display: none; }
  .rail-foot { margin: 0 0 0 auto; }
  .rail-foot span { display: none; }
  .rail-foot button { margin: 0; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  main { padding: 10px 16px 104px; }
  .page-title { font-size: 21px; margin: 0; }
  .pair, .trio { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 18px 16px 10px; border-radius: 18px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }

  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    z-index: 10;
  }

  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
  }

  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--green); }
  .tabbar .label-long { display: none; }
  .tabbar .label-short { display: inline; }
}
