/* RestroHub — warm theme tokens lifted from the original app */
:root {
  --bg: #faf8f5;
  --bg-2: #fff9f5;
  --card: #ffffff;
  --fg: #292524;
  --fg-strong: #07090d;
  --muted: #f7f0ed;
  --muted-fg: #6e605a;
  --border: #ecded7;
  --border-warm: #f3dec8;

  --accent: #f24700;
  --accent-hover: #da3300;
  --accent-700: #af2f00;
  --accent-100: #ffe9dd;
  --accent-200: #ffcdb4;
  --accent-50: #fff7f1;

  --green: #009962;
  --blue: #326ad9;
  --amber: #cf9c00;
  --red: #cc272e;
  --violet: #b84999;
  --teal: #00787d;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(41, 37, 36, 0.04), 0 8px 24px -18px rgba(41, 37, 36, 0.25);

  --sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; color: var(--fg-strong); letter-spacing: -0.01em; }
h1 { font-size: 20px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted-fg); }
.small { font-size: 12px; }
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 420px at 50% -12%, #ffe9dd 0%, rgba(255, 233, 221, 0) 72%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 404px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 28px 26px;
  box-shadow: var(--shadow);
}
.brandbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--muted);
}
.brandbar .brand-sub {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
}
/* The brand lockup is one image: the full mark in the login card, and the chef-hat
   emblem cropped into a square in the sidebar. */
.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 12px -8px rgba(15, 32, 60, 0.55);
}
.brand-mark .brand-logo {
  position: absolute;
  width: 116px;
  height: auto;
  left: -35px;
  top: 0;
}
.login-card .brand-mark {
  width: auto;
  height: auto;
  overflow: visible;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.login-card .brand-mark .brand-logo {
  position: static;
  width: 236px;
  max-width: 100%;
  height: auto;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .lead { color: var(--muted-fg); font-size: 13px; margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
}
.field label .req { color: var(--accent); margin-left: 2px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--fg-strong);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent-200);
  box-shadow: 0 0 0 3px var(--accent-50), 0 0 0 1px var(--accent-200);
}
.field .hint { margin-top: 6px; font-size: 11.5px; color: var(--muted-fg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-50); border-color: var(--border-warm); }
/* A label can stand in for a button (the checklist import opens a file picker). */
label.btn { cursor: pointer; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-block { width: 100%; padding: 11px 15px; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted-fg); }
.btn-ghost:hover { background: var(--muted); color: var(--fg); }

.form-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fdecec;
  border: 1px solid #f7c9c9;
  color: #8f1d1d;
  font-size: 12.5px;
}
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted-fg);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--muted);
}
.btn-google {
  background: #fff;
  border-color: var(--border);
  color: var(--fg-strong);
  font-weight: 600;
}
.btn-google:hover { background: var(--bg-2); border-color: var(--border-warm); }
.g-mark { flex: none; }
.login-alt {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.login-alt:has(.link-btn:only-child) { justify-content: center; }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-700);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.outlet-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.outlet-chips .chip { padding: 3px 7px; font-size: 10.5px; }
.outlet-bulk { display: flex; align-items: center; gap: 10px; margin-top: 5px; }

.role-select {
  margin-top: 2px;
  max-width: 158px;
  padding: 2px 6px;
  font: inherit;
  font-size: 11.5px;
  color: var(--muted-fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}
.role-select:focus { outline: none; border-color: var(--accent-200); box-shadow: 0 0 0 2px var(--accent-50); }

.loading-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.loading-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--accent);
  animation: load-slide 1.1s ease-in-out infinite;
}
/* Attendance camera + punch card */
.camera-box {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #14100c;
  border: 1px solid rgba(24, 20, 16, 0.12);
}

.camera-box video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #14100c;
  transform: scaleX(-1);
}

.camera-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.camera-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.punch-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.punch-shot {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(24, 20, 16, 0.14);
  display: block;
  margin-top: 6px;
}

/* Licence certificate: a square thumbnail in the row, a preview inside the form. */
.license-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}
.license-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.license-thumb-img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid rgba(24, 20, 16, 0.14);
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .punch-row { grid-template-columns: 1fr; }
  .license-thumb { width: 46px; height: 46px; }
}

/* Workspace boot animation — twelve rounded pills in a ring, fading one after another. */
.boot-spinner {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 8px auto 20px;
}

.boot-spinner span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 24px;
  margin-left: -5px;
  border-radius: 999px;
  transform-origin: 50% 38px;
  animation: boot-spinner-fade 1.15s linear infinite;
}

.boot-spinner span:nth-child(1)  { transform: rotate(0deg);   background: #0a0ac2; animation-delay: -1.15s; }
.boot-spinner span:nth-child(2)  { transform: rotate(30deg);  background: #0e1ad4; animation-delay: -1.054s; }
.boot-spinner span:nth-child(3)  { transform: rotate(60deg);  background: #1232e2; animation-delay: -0.958s; }
.boot-spinner span:nth-child(4)  { transform: rotate(90deg);  background: #2a6bf4; animation-delay: -0.862s; }
.boot-spinner span:nth-child(5)  { transform: rotate(120deg); background: #57a9f2; animation-delay: -0.767s; }
.boot-spinner span:nth-child(6)  { transform: rotate(150deg); background: #93daf8; animation-delay: -0.671s; }
.boot-spinner span:nth-child(7)  { transform: rotate(180deg); background: #c6effc; animation-delay: -0.575s; }
.boot-spinner span:nth-child(8)  { transform: rotate(210deg); background: #a9e8fb; animation-delay: -0.479s; }
.boot-spinner span:nth-child(9)  { transform: rotate(240deg); background: #74c4f4; animation-delay: -0.383s; }
.boot-spinner span:nth-child(10) { transform: rotate(270deg); background: #3d8af4; animation-delay: -0.288s; }
.boot-spinner span:nth-child(11) { transform: rotate(300deg); background: #1c4cee; animation-delay: -0.192s; }
.boot-spinner span:nth-child(12) { transform: rotate(330deg); background: #101fd6; animation-delay: -0.096s; }

@keyframes boot-spinner-fade {
  0% { opacity: 1; }
  100% { opacity: 0.14; }
}

.boot-caption {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 0;
  font-size: 13.5px;
  color: var(--muted-fg, #6f6a63);
}

/* Three dots that fade in one after another, without animating generated content. */
.boot-ellipsis {
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
}

.boot-ellipsis::before,
.boot-ellipsis::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: boot-blink 1.2s ease-in-out infinite;
}

.boot-ellipsis::before { animation-delay: 0.15s; }
.boot-ellipsis::after { animation-delay: 0.3s; }

@keyframes boot-blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-spinner span,
  .boot-ellipsis::before,
  .boot-ellipsis::after { animation: none; }

  .boot-spinner span { opacity: 0.65; }
}

@keyframes load-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
.app-error {
  margin: 12px 20px 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: #fdecec;
  border: 1px solid #f7c9c9;
  color: #8f1d1d;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-notice {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #eef7ee;
  border: 1px solid #cbe6cb;
  color: #2a6b2a;
  font-size: 12.5px;
}

.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--muted);
  font-size: 11.5px;
  color: var(--muted-fg);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 18px 14px;
  background: var(--bg-2);
  border-right: 1px solid var(--border-warm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar .brandbar { padding-bottom: 14px; margin-bottom: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted-fg);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--muted); color: var(--fg); }
.nav a.active {
  background: #fff;
  border-color: var(--border);
  color: var(--fg-strong);
  box-shadow: 0 1px 2px rgba(41, 37, 36, 0.03);
}
.nav a.active svg { color: var(--accent); }
.nav .count {
  margin-left: auto;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: 11px;
  font-weight: 600;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 12px; }
.nav-label {
  padding: 0 11px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-fg);
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border-warm); padding-top: 12px; }
.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-warm);
}
.topbar .scope { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.select {
  appearance: none;
  padding: 7px 30px 7px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e605a' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 9px center;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.mobile-nav { display: none; }

.content { padding: 22px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted-fg); font-size: 12.5px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Cards, grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.card-head .link { margin-left: auto; font-size: 12px; color: var(--accent-700); text-decoration: none; font-weight: 500; }
.card-head .link:hover { text-decoration: underline; }

.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.two-col { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 12px; color: var(--muted-fg); font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -0.02em; line-height: 1.1; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted-fg); margin-left: 2px; }
.kpi .delta { font-size: 11.5px; color: var(--muted-fg); display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--green); font-weight: 600; }
.trend-down { color: var(--red); font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--fg);
  white-space: nowrap;
}
.pill-orange { background: var(--accent-50); border-color: var(--accent-200); color: var(--accent-700); }
.pill-red { background: #fdecec; border-color: #f7c9c9; color: #8f1d1d; }
.pill-amber { background: #fdf5dc; border-color: #f2e2ae; color: #6d5200; }
.pill-green { background: #e6f6ef; border-color: #bfe6d5; color: #00603f; }
.pill-blue { background: #eaf0fd; border-color: #cddcfa; color: #1d4aa3; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Tables / lists ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.2fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--muted);
}
.row:first-child { border-top: none; }
.row .title { font-weight: 500; color: var(--fg-strong); }
.row .meta { font-size: 11.5px; color: var(--muted-fg); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.row .right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* Users row: identity, scope, role select, last change and Delete. Five columns only fit on
 * a wide screen; below that the row stacks so the select, chips and Delete never overlap. */
.user-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) auto auto auto; }
.user-row > * { min-width: 0; }
@media (max-width: 900px) {
  .user-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    row-gap: 10px;
  }
  .user-row > :nth-child(1),
  .user-row > :nth-child(2),
  .user-row > :nth-child(3) { grid-column: 1 / -1; }
  .user-row > :nth-child(4) { grid-column: 1 / 2; justify-self: start; }
  .user-row > :nth-child(5) { grid-column: 2 / 3; justify-self: end; }
  .user-row .select { width: 100%; }
  .user-row .right { justify-content: flex-start; }
  .user-row .outlet-bulk { flex-wrap: wrap; gap: 6px; }
}

.alert-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--muted);
  align-items: flex-start;
}
.alert-item:first-child { border-top: none; }
.alert-icon {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-50); color: var(--accent-700);
}
.alert-item strong { font-size: 12.5px; font-weight: 600; color: var(--fg-strong); display: block; }
.alert-item span { font-size: 11.5px; color: var(--muted-fg); }

/* ---------- Charts ---------- */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 148px; padding-top: 8px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #ff8547, #f24700);
  transition: height 0.3s;
}
.chart .bar.breach { background: linear-gradient(180deg, #e0646a, #cc272e); }
.chart .bar.soft { background: linear-gradient(180deg, #ffcdb4, #ffa680); }
.chart .cap { font-size: 10.5px; color: var(--muted-fg); font-family: var(--mono); }
.chart .val { font-size: 10.5px; color: var(--fg); font-weight: 600; }

.progress { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.progress.done > i { background: var(--green); }

/* ---------- Photos ---------- */
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); }
.photo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.photo-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 90% at 30% 15%, #ffe9dd 0%, #f7d9c6 42%, #d9b8a4 100%);
  display: grid;
  place-items: center;
  color: #7a4a2f;
}
.photo-thumb svg { opacity: 0.55; }
.photo-thumb .stamp {
  position: absolute;
  left: 8px; bottom: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(41, 37, 36, 0.62);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
}
.photo-thumb.missing {
  background: repeating-linear-gradient(135deg, #f7f0ed 0 8px, #f0e7e1 8px 16px);
  color: var(--muted-fg);
}
.photo-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; }
.photo-body .top { display: flex; align-items: center; gap: 8px; }
.photo-body .top strong { font-size: 12.5px; }
.photo-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.photo-foot .btn { margin-left: auto; }

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(41, 37, 36, 0.32);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: min(460px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: -24px 0 48px -32px rgba(41, 37, 36, 0.5);
}
.drawer-head { display: flex; align-items: flex-start; gap: 10px; }
.drawer-head .btn { margin-left: auto; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted-fg); }
.kv dd { margin: 0; color: var(--fg); }
.timeline { display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--border-warm); padding-left: 14px; }
.timeline .entry { position: relative; }
.timeline .entry::before {
  content: "";
  position: absolute;
  left: -19px; top: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-200);
  border: 2px solid #fff;
}
.timeline .entry strong { font-size: 12.5px; display: block; }
.timeline .entry span { font-size: 11.5px; color: var(--muted-fg); }

.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 500;
}
.chip:hover { background: var(--accent-50); }
.chip.active { background: var(--fg-strong); border-color: var(--fg-strong); color: #fff; }

.empty { padding: 26px 8px; text-align: center; color: var(--muted-fg); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .three-col { grid-template-columns: minmax(0, 1fr); }
}
/* Mobile account chip: the footer sits under the whole page, too far away to be
 * the answer to "which account is this?". Hidden on desktop, where the sidebar
 * footer is always on screen. */
.topbar-account { display: none; }

/* Admin role preview: visible whatever role is being previewed, so the exit is
 * always one tap away even when the previewed role hides admin controls. */
.role-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: none;
  padding: 8px 22px;
  background: var(--accent-50);
  border-bottom: 1px solid var(--border-warm);
  font-size: 12.5px;
  color: var(--fg);
}
.role-preview strong { color: var(--fg-strong); }
.role-preview .btn { margin-left: auto; }
@media (max-width: 900px) {
  .role-preview { padding: 8px 14px; }
  .role-preview .btn { margin-left: 0; }
}

/* Desktop: the sidebar and the page scroll on their own. A long nav list never
 * drags the page with it, and a long page never scrolls the nav out of reach. */
@media (min-width: 901px) {
  html, body { height: 100%; }
  .shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .sidebar {
    position: static;
    align-self: stretch;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
  .sidebar .nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }
  .main { height: 100%; min-height: 0; overflow: hidden; }
  .topbar { position: static; flex: none; }
  .content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .page-foot { flex: none; }
}

/* Bottom tab bar: every section in one row that swipes sideways. */
.mobile-sheet { display: none; }
.check-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.check-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-warm);
    background: var(--bg-2);
    box-shadow: 0 -6px 24px -18px rgba(41, 37, 36, 0.45);
    /* All sections live in one row: a swipe reaches the ones off-screen. */
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-tab {
    flex: 0 0 auto;
    min-width: 66px;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 5px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted-fg);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
  }
  .mobile-tab { position: relative; }
  .mobile-tab svg { flex: none; }
  .mobile-tab.active { background: var(--accent-100); color: var(--accent-700); }
  .mobile-tab .count {
    position: absolute;
    transform: translate(14px, -18px);
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
  }
  .content { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .page-foot { margin-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .topbar .scope { width: 100%; min-width: 0; }
  .topbar .scope .select { flex: 1; min-width: 0; max-width: none; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .page-head .actions .select { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .hide-sm { display: none; }

  body.sheet-open { overflow: hidden; overscroll-behavior: none; }
  .mobile-sheet {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 45;
    flex-direction: column;
    justify-content: flex-end;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: contain;
  }
  .sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15, 10, 5, 0.38); }
  .mobile-sheet-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: 18px 18px 0 0;
    padding: 0;
    max-height: 78vh;
    max-height: min(78dvh, calc(100dvh - env(safe-area-inset-top) - 8px));
    overflow: hidden;
    box-shadow: 0 -12px 40px rgba(41, 37, 36, 0.24);
  }
  .mobile-sheet-head {
    flex: none;
    padding: 16px 16px 8px;
    background: var(--card);
    border-bottom: 1px solid var(--muted);
  }
  .mobile-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 8px 16px calc(84px + env(safe-area-inset-bottom));
  }
  .mobile-sheet-card a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 11px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted-fg);
    font-size: 14px;
    font-weight: 500;
  }
  .mobile-sheet-card a.active { background: var(--accent-100); color: var(--accent-700); }
  .mobile-sheet-card .nav-label { margin-top: 12px; }

  .topbar-account {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    max-width: 44vw;
    padding: 3px 10px 3px 4px;
    border: 1px solid var(--border-warm);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    color: var(--fg);
    cursor: pointer;
  }
  .topbar-account .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 10.5px;
  }
  .topbar-account-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .account-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--border-warm);
    border-radius: 14px;
    background: var(--bg-2);
  }
  .account-card .avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 13px;
  }
  .account-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg-strong);
  }
  .account-card-email {
    font-size: 12.5px;
    color: var(--accent-700);
    font-weight: 600;
    word-break: break-all;
  }
  .account-actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
  }
  .account-actions .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .check-row { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  .check-row .check-dot { margin-top: 2px; }
  .check-row .check-read { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .check-row .check-actions { grid-column: 1 / -1; justify-content: stretch; gap: 8px; }
  .check-row .check-actions .btn { flex: 1 1 auto; min-height: 46px; justify-content: center; font-size: 13px; }
  .check-row .check-actions .link-btn { min-height: 46px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 24px 20px 22px; }
}

/* ---------- Inventory count sheet ---------- */
.count-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.count-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12.5px;
}
.count-table th {
  background: #f1f4fa;
  color: var(--muted-fg);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.count-table th.num { text-align: right; }
.count-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--muted);
  vertical-align: middle;
}
.count-table tbody tr:last-child td { border-bottom: 0; }
.count-table tbody tr:hover { background: var(--accent-50); }
/* All-outlet count: each kitchen starts a clearly labelled section. */
.count-outlet-row td { background: #f1f4fa; padding: 9px 14px; border-top: 1px solid var(--border); }
.count-outlet-row:first-child td { border-top: 0; }
.count-outlet-row td > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.count-outlet-row strong { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--fg-strong); }
.count-outlet-row .pill { font-size: 10.5px; }
/* Per-outlet subtotals: counted value plus priced short/over for that kitchen. */
.count-outlet-sum { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted-fg); }
.count-outlet-sum strong { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--fg-strong); }
/* Short and over read as buttons: each opens the SKUs that make up its total. */
.count-outlet-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.count-outlet-chip:hover { border-color: currentColor; }
.count-outlet-chip[aria-expanded="true"] { background: #eef2f9; border-color: currentColor; }
.count-outlet-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count-outlet-chip .count-outlet-chev { width: 10px; height: 10px; font-size: 9px; color: inherit; }
/* Breakdown panel: the priced rows behind one outlet's short or over figure. */
.count-breakdown-row td { background: #fff; padding: 10px 14px 12px; border-top: 1px solid var(--border); }
.count-breakdown-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.count-breakdown-head strong { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-strong); }
.count-breakdown-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.count-breakdown-list li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 96px 80px 88px;
  gap: 10px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--muted);
  font-size: 12px;
}
.count-breakdown-list li:last-child { border-bottom: 0; }
.count-breakdown-list .sku { font-family: var(--mono); font-size: 11.5px; color: var(--muted-fg); white-space: nowrap; }
.count-breakdown-list .name { color: var(--fg-strong); font-weight: 500; }
.count-breakdown-list .qty { text-align: right; white-space: nowrap; }
.count-breakdown-list .rate { text-align: right; font-size: 11px; color: var(--muted-fg); white-space: nowrap; }
.count-breakdown-list .amount { text-align: right; font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.count-breakdown-empty { margin: 0; }
/* The count sheet can run long, so the submit action repeats at its foot. */
.count-submit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
@media (max-width: 640px) {
  /* On a phone the button gets its own full-width row, with the progress line above it. */
  .count-submit-bar { flex-direction: column; align-items: stretch; }
  .count-submit-bar .btn { justify-content: center; min-height: 46px; }
  .count-submit-bar .small { text-align: center; }
}
/* Each kitchen section folds away, so a long all-outlets sheet stays scannable;
 * its counted, short and over subtotals stay in the header either way. */
.count-outlet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.count-outlet-toggle:hover strong { text-decoration: underline; }
.count-outlet-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.count-outlet-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
  font-size: 11px;
  line-height: 1;
  color: var(--accent);
}

@media (max-width: 640px) {
  /* The count table scrolls sideways on a phone, but an outlet's name and its
   * subtotals must wrap inside the visible width instead of sitting off-screen. */
  .count-outlet-row td > div {
    max-width: calc(100vw - 40px);
    justify-content: flex-start;
    /* The quantity inputs sit to the right, so the outlet name and its subtotals
     * stay pinned while the sheet is scrolled sideways to reach them. */
    position: sticky;
    left: 6px;
  }
  .count-outlet-sum { flex-basis: 100%; }
  /* The breakdown sits inside the sideways-scrolling sheet; keep it near the
   * section header so nothing important hides off-screen on a phone. */
  .count-breakdown-row td { padding-left: 20px; }
  .count-breakdown-list { max-width: calc(100vw - 64px); }
  .count-breakdown-list li { grid-template-columns: 68px minmax(0, 1fr) 88px; }
  .count-breakdown-list .rate { display: none; }
  .count-breakdown-list .amount { grid-column: 2 / 4; }
}
.count-table td.sku {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-fg);
  white-space: nowrap;
}
.count-table td.name { font-weight: 500; color: var(--fg-strong); min-width: 200px; }
.count-table td.estimate {
  text-align: right;
  font-family: var(--mono);
  white-space: nowrap;
}
.count-entry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-entry input {
  width: 78px;
  padding: 7px 9px;
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  color: var(--fg-strong);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.count-entry select {
  appearance: none;
  padding: 7px 26px 7px 9px;
  font: inherit;
  font-size: 12px;
  color: var(--fg);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e605a' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 8px center;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.count-entry input:focus,
.count-entry select:focus {
  outline: none;
  border-color: var(--accent-200);
  box-shadow: 0 0 0 3px var(--accent-50);
}
.count-table td.count-value { text-align: right; white-space: nowrap; }
.count-table td.count-value strong { display: block; font-size: 13px; font-weight: 600; color: var(--fg-strong); }
.count-table td.count-value span { font-size: 11px; color: var(--muted-fg); }

.count-table { min-width: 860px; }
.count-table td.count-variance {
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}
.variance.short { color: #8f1d1d; font-weight: 600; }
.variance.over { color: #00603f; font-weight: 600; }
.variance.zero { color: var(--muted-fg); }
.count-table tfoot td {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  background: #fbfbfd;
  font-size: 12px;
}
.count-foot-totals { text-align: right; white-space: nowrap; }
.count-foot-totals .variance + .variance { margin-left: 16px; }

/* ---------- Inventory management module ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 900px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-fg);
  background: #fbfbfd;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--muted);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--accent-50); }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .inv-check { width: 34px; text-align: center; }

.form-ok {
  background: #e6f6ef;
  border: 1px solid #bfe6d5;
  color: #00603f;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.btn-danger { border-color: #f7c9c9; color: #8f1d1d; background: #fdecec; }

.inv-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.inv-stats-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inv-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.inv-stat-value {
  font-size: 21px;
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
}
.inv-stat.warn { border-color: #f2e2ae; background: #fffdf3; }
.inv-stat.warn .inv-stat-value { color: #6d5200; }
.inv-stat.bad { border-color: #f7c9c9; background: #fff7f7; }
.inv-stat.bad .inv-stat-value { color: #8f1d1d; }

.inv-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.inv-grid-2 > .card { margin: 0; }

.inv-bars { display: flex; flex-direction: column; gap: 9px; }
.inv-bar {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.inv-bar-label { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-bar-track { height: 8px; background: var(--muted); border-radius: 99px; overflow: hidden; }
.inv-bar-track i { display: block; height: 100%; background: linear-gradient(90deg, #ff9a68, var(--accent)); border-radius: 99px; }
.inv-bar-value { font-family: var(--mono); font-size: 11.5px; color: var(--muted-fg); }

.inv-week { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding: 6px 2px 0; }
.inv-week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.inv-week-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.inv-week-bars i { width: 9px; border-radius: 4px 4px 0 0; display: block; min-height: 2px; }
.inv-week-bars i.in,
.inv-legend i.in { background: var(--green); }
.inv-week-bars i.out,
.inv-legend i.out { background: var(--accent); }
.inv-week-bars i.tr,
.inv-legend i.tr { background: var(--blue); }
.inv-week-col span { font-size: 10.5px; color: var(--muted-fg); }
.inv-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted-fg); }
.inv-legend span { display: flex; align-items: center; gap: 6px; }
.inv-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.inv-toolbar select,
.inv-toolbar input[type="date"] {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--fg);
}
.inv-toolbar-actions { margin-left: auto; display: flex; gap: 6px; }
.inv-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  min-width: 250px;
  flex: 1 1 260px;
  max-width: 380px;
  color: var(--muted-fg);
}
.inv-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--fg);
  width: 100%;
}

.inv-tabs { display: flex; gap: 4px; }
.inv-tab {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted-fg);
}
.inv-tab.active { background: var(--accent-50); border-color: var(--accent-200); color: var(--accent-700); font-weight: 600; }

.inv-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: var(--accent-50);
  border: 1px solid var(--accent-200);
  border-radius: 10px;
}
.inv-bulk .btn { margin-left: 0; }
.inv-bulk .small:first-child { margin-right: 6px; font-weight: 600; }

.inv-duplicate-card {
  margin-bottom: 14px;
  border-color: #f2e2ae;
  background: #fffdf6;
}
.inv-duplicate-card .card-head { margin-bottom: 8px; }
.inv-dup-row { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 640px) {
  .inv-dup-row { grid-template-columns: minmax(0, 1fr); }
  .inv-dup-row .right { justify-content: flex-start; }
}

.inv-row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.status-pill.ok { background: #e6f6ef; border-color: #bfe6d5; color: #00603f; }
.status-pill.warn { background: #fdf5dc; border-color: #f2e2ae; color: #6d5200; }
.status-pill.bad { background: #fdecec; border-color: #f7c9c9; color: #8f1d1d; }
.status-pill.off { background: var(--muted); color: var(--muted-fg); }

.txn-type { font-size: 11.5px; font-weight: 600; }
.txn-type.in, .txn-qty.in { color: var(--green); }
.txn-type.out, .txn-qty.out { color: var(--accent-700); }
.txn-qty { font-family: var(--mono); font-weight: 600; white-space: nowrap; }

.inv-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.inv-empty { padding: 26px 14px; text-align: center; }
.inv-empty p { margin: 6px 0 12px; }

.inv-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.inv-form-grid .field { margin: 0; }
.inv-form-grid input[readonly] { background: var(--muted); color: var(--muted-fg); }
.inv-form-foot { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Multi-item movement forms: one block per line item, sharing the form grid. */
.inv-lines { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.inv-line {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 14px;
  background: var(--bg-2);
}
.inv-line-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.inv-line-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.inv-line-head .btn { margin-left: auto; min-height: 36px; }
/* On phones the line head wraps: keep the remove control a full-width, finger-sized row. */
@media (max-width: 620px) {
  .inv-line-head .btn { min-height: 40px; margin-left: auto; }
}
.inv-line .inv-form-grid { gap: 10px; }
.inv-check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.inv-check-line input { width: auto; }

.inv-ing-head,
.inv-ing-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 110px 100px auto;
  gap: 8px;
  align-items: center;
}
.inv-ing-head { margin: 14px 0 6px; }
.inv-ing-row { margin-bottom: 8px; }
.inv-ing-row select,
.inv-ing-row input {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 9px;
  font: inherit;
  font-size: 12.5px;
  background: var(--card);
}
@media (max-width: 620px) {
  .inv-ing-head { display: none; }
  .inv-ing-row { grid-template-columns: 1fr 1fr; }
}

.inv-image-preview img {
  max-width: 160px;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 8px;
  object-fit: cover;
}

.route-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--muted);
  flex-wrap: wrap;
}
.route-row:last-child { border-bottom: 0; }
.route-row > div:first-child { flex: 1 1 200px; min-width: 0; }
.route-row .title { font-weight: 500; color: var(--fg-strong); }
.route-row .meta { font-size: 11.5px; color: var(--muted-fg); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.inv-bad { color: #8f1d1d; }

@media print {
  .sidebar, .banner, .inv-toolbar, .page-head .actions, .inv-pager, .inv-row-actions { display: none !important; }
  .main { padding: 0 !important; }
  .card { border: 0 !important; box-shadow: none !important; }
  .data-table { min-width: 0; }
  .data-table th { background: #fff; }
}

/* Checklist rows + live freezer capture (rear camera, so not mirrored) */
.check-dot {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
}
.check-dot.done { background: var(--green); border-color: var(--green); }
#check-video { transform: none; }

/* Opening screen: just the lockup and the buffer animation */
.boot-splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg);
}
.boot-splash > img { width: 170px; height: auto; }
.boot-splash .boot-spinner { margin: 0; }
.boot-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
}
.boot-card .brandbar {
  border: 0;
  padding: 0;
  margin: 0;
  justify-content: center;
  width: 100%;
}
.boot-card .brand-mark {
  width: auto;
  height: auto;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.boot-card .brand-mark .brand-logo {
  position: static;
  width: 170px;
  height: auto;
  left: auto;
  top: auto;
}
.boot-card .boot-spinner { margin: 20px auto 0; }

/* Page footer with the sign-out action */
.page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 26px;
  border-top: 1px solid var(--muted);
}

/* Checklist history: completion per kitchen for the chosen day */
.checklist-history-wrap { overflow-x: auto; }
.checklist-history {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12.5px;
}
.checklist-history th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-fg);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.checklist-history td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--muted);
  vertical-align: middle;
}
.checklist-history tr.current td { background: var(--accent-50); }
.checklist-history tbody tr:last-child td { border-bottom: 0; }

/* Monthly attendance / salary report */
.attendance-report-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 13px;
}

.attendance-report .table-wrap { margin-top: 4px; }

.attendance-report .data-table tfoot th {
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #fbfbfd;
  border-top: 1px solid var(--border);
}

@media print {
  /* Desktop keeps the app in viewport-height scroll areas; printing needs the
   * whole document to flow onto paper instead. */
  html, body { height: auto !important; }
  .shell, .main, .content { height: auto !important; overflow: visible !important; }
  body.print-attendance .sidebar,
  body.print-attendance .topbar,
  body.print-attendance .mobile-nav,
  body.print-attendance .mobile-sheet,
  body.print-attendance .page-foot,
  body.print-attendance .app-error,
  body.print-attendance .no-print { display: none !important; }
  body.print-attendance .main,
  body.print-attendance .content { padding: 0 !important; }
  body.print-attendance .attendance-report { margin: 0 !important; }
  body.print-attendance .attendance-report .table-wrap { overflow: visible; border: 0; }
  body.print-attendance .attendance-report .data-table { min-width: 0; font-size: 11px; }
  body.print-attendance .attendance-report thead { display: table-header-group; }
  body.print-attendance .attendance-report tr { break-inside: avoid; }
}

/* Pay rate controls in the monthly attendance report */
.pay-rate {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.pay-cur {
  color: var(--muted-fg);
  font-size: 11.5px;
}

.pay-rate-input {
  width: 72px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  text-align: right;
  color: var(--fg);
  background: var(--card);
}

.pay-advance { width: 64px; }

.pay-basis {
  padding: 5px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 11.5px;
  color: var(--fg);
  background: var(--card);
}

@media print {
  body.print-attendance .attendance-report .pay-rate-input,
  body.print-attendance .attendance-report .pay-basis {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    width: auto;
    font-size: 11px;
    appearance: none;
  }
}

/* ------------------------------------------------------------------ Solvie */
/* The assistant is a floating panel outside #app so a page render never
   interrupts a conversation. The box is only as big as its launcher — the panel
   is absolutely positioned off it — so the launcher can be dragged anywhere on
   the screen without the panel changing its place. */
.solvie {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /* Never let the launcher push past the screen edge: a clipped pill would
   * leave only its leading dot visible. */
  max-width: calc(100vw - 24px);
}
.solvie--dragging { user-select: none; -webkit-user-select: none; }
.solvie--hidden { display: none; }
.solvie-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  max-width: 100%;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent-hover);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: grab;
  /* The launcher is dragged, so a touch on it must move it, not scroll the page. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 10px 24px rgba(24, 20, 16, 0.18);
}
.solvie--dragging .solvie-launcher { cursor: grabbing; }
.solvie-launcher:hover { background: var(--accent-hover); }
.solvie-launcher span:last-child { display: inline; }
.solvie-launcher .solvie-dot { flex: none; }
.solvie-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bff0d8;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}
.solvie-panel {
  /* Pinned to the launcher, never in its layout flow: the button keeps the spot
   * it was dropped in, whether the panel is open or not. */
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-warm);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(24, 20, 16, 0.22);
  overflow: hidden;
}
.solvie-panel[hidden] { display: none; }
/* Not enough room above the launcher: drop the panel below it. */
.solvie--panel-flip .solvie-panel { top: calc(100% + 10px); bottom: auto; }
/* The launcher can sit near an edge, so the panel nudges sideways to stay on
 * screen; the shift is measured from its default right-aligned position. */
.solvie .solvie-panel { transform: translateX(var(--solvie-panel-shift, 0px)); }
.solvie-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--muted);
  background: var(--accent-50);
}
.solvie-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.solvie-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.solvie-title strong { font-size: 14px; }
.solvie-title span { font-size: 11px; color: var(--muted-fg); }
.solvie-head .btn { margin-left: auto; flex: none; }
/* "Back to the corner" control, offered only once the launcher has been moved. */
.solvie-home { padding: 4px 5px; }
.solvie-home[hidden] { display: none; }
.solvie-home svg { display: block; }
.solvie-log {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 130px;
}
.solvie-msg { display: flex; }
.solvie-msg--user { justify-content: flex-end; }
.solvie-bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.solvie-msg--bot .solvie-bubble {
  background: var(--muted);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.solvie-msg--user .solvie-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.solvie-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.solvie-chips[hidden] { display: none; }
.solvie-form {
  border-top: 1px solid var(--muted);
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}
.solvie-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.solvie-input {
  width: 100%;
  resize: vertical;
  min-height: 46px;
  max-height: 120px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 13px;
}
.solvie-input:focus { outline: 2px solid var(--accent-200); outline-offset: 1px; }
.solvie-actions { display: flex; align-items: center; gap: 10px; }
.solvie-note { font-size: 11px; color: var(--muted-fg); flex: 1; }
.solvie .btn-primary { margin-left: auto; }

@media (max-width: 640px) {
  /* Clear the phone bottom bar. */
  .solvie { right: 12px; bottom: 82px; }
  .solvie-panel { width: calc(100vw - 24px); max-height: calc(100vh - 190px); }
}
.solvie-divider {
  text-align: center;
  font-size: 11px;
  color: var(--muted-fg);
  margin: 2px 0 4px;
}
