/* =================================================================
   SNOWFALL admin — Food Safety  (mobile-first)
   ================================================================= */
:root {
  --black:   #000000;
  --white:   #ffffff;
  --snow:    #f7f4ef;
  --stone:   #d5cec4;
  --stone-2: #ece8e1;
  --ink-70:  rgba(0,0,0,0.70);
  --ink-50:  rgba(0,0,0,0.52);
  --ink-30:  rgba(0,0,0,0.30);
  --ink-12:  rgba(0,0,0,0.12);
  --ink-06:  rgba(0,0,0,0.055);

  --green:   #5f8a63;   /* complete / ok */
  --green-bg:#eaf1ea;
  --red:     #b23a44;   /* warning / over limit */
  --red-bg:  #fbeced;
  --amber:   #b07d2e;

  --display: "TAN Tangkiwood", "Playfair Display", Georgia, serif;
  --body:    "Aristotelica Pro", "Outfit", system-ui, sans-serif;

  --bar-h: 60px;
  --maxw: 760px;
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--black);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* the brand highlight box */
.hl {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.06em 0.34em 0.16em;
  line-height: 1.1;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 52px;
  padding: 0.7em 1.4em;
  border: 1.5px solid var(--black);
  border-radius: 14px;
  background: var(--white);
  color: var(--black);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn--solid { background: var(--black); color: var(--white); }
.btn--block { width: 100%; }
.btn--ghost { border-color: var(--ink-12); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn--danger { border-color: var(--red); color: var(--red); background: var(--white); }
.btn--sm { min-height: 40px; padding: 0.45em 0.9em; border-radius: 10px; font-size: 0.82rem; }

/* ---------- login ---------- */
.login {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 1.5rem;
  background: var(--white);
}
.login__card {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 1rem;
}
.login__logo { font-size: 1.5rem; align-self: flex-start; }
.login__title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: 2rem; letter-spacing: 0.01em; margin-top: 0.3rem;
}
.login__sub { color: var(--ink-50); margin-bottom: 0.4rem; }
.login__error {
  background: var(--red-bg); color: var(--red);
  padding: 0.7em 1em; border-radius: 10px; font-size: 0.85rem; font-weight: 500;
}

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field > span {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-70);
}
.field > span em { font-style: normal; color: var(--ink-30); letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.7em 0.9em;
  border: 1.5px solid var(--ink-12);
  border-radius: 12px;
  background: var(--white);
  color: var(--black);
  transition: border-color 0.2s ease;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--black);
}
.field--temp input { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- app shell ---------- */
.app { min-height: 100svh; padding-top: var(--bar-h); }
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--ink-12);
}
.bar__menu {
  width: 42px; height: 42px; border: 0; background: none; border-radius: 10px;
  display: grid; align-content: center; gap: 5px; padding: 0 9px;
  flex: none;
}
.bar__menu span { height: 2px; background: var(--black); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.bar__menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bar__menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bar__menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.bar__brand { display: flex; align-items: baseline; gap: 0.5rem; margin-right: auto; }
.bar__brand .hl { font-size: 1.05rem; }
.bar__sub {
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-50);
}
.bar__user {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
}

/* ---------- drawer ---------- */
.drawer {
  position: fixed; top: var(--bar-h); bottom: 0; left: 0; z-index: 31;
  width: 270px; max-width: 84vw;
  background: var(--white);
  border-right: 1px solid var(--ink-12);
  padding: 0.8rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  transform: translateX(-103%);
  transition: transform 0.32s cubic-bezier(0.22,0.61,0.36,1);
}
.drawer.is-open { transform: none; }
.drawer a {
  padding: 0.95em 1em;
  border-radius: 12px;
  font-weight: 500;
  color: var(--ink-70);
}
.drawer a.is-active { background: var(--black); color: var(--white); }
.drawer__signout {
  margin-top: auto; border: 0; background: none; text-align: left;
  padding: 0.95em 1em; color: var(--red); font-weight: 600; border-radius: 12px;
}
.scrim { position: fixed; inset: var(--bar-h) 0 0 0; z-index: 30; background: rgba(0,0,0,0.32); }

/* ---------- main / views ---------- */
.main { max-width: var(--maxw); margin-inline: auto; padding: 1.25rem 1rem 4rem; }
.view__head { margin-bottom: 1.25rem; }
.view__title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.7rem; letter-spacing: 0.01em; }
.view__sub { color: var(--ink-50); margin-top: 0.35rem; font-size: 0.92rem; }
.back {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-50); margin-bottom: 0.9rem;
}

/* cards */
.card {
  border: 1px solid var(--ink-12); border-radius: 16px;
  padding: 1.1rem; background: var(--white); margin-bottom: 1rem;
}
.card__label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-50); margin-bottom: 0.5rem; }

/* ---------- dashboard ---------- */
.dash__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
.stat {
  border: 1px solid var(--ink-12); border-radius: 16px; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.stat__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-50); }
.stat__value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__value.is-temp { font-family: var(--body); }
.stat--wide { grid-column: 1 / -1; }

.status-pill {
  display: inline-flex; align-items: center; gap: 0.45em;
  padding: 0.3em 0.7em; border-radius: 100px;
  font-size: 0.78rem; font-weight: 600;
}
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.is-complete { color: var(--green); background: var(--green-bg); }
.is-missing  { color: var(--ink-50); background: var(--ink-06); }
.is-issue    { color: var(--red); background: var(--red-bg); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 0.4rem; }
.quick a {
  border: 1.5px solid var(--black); border-radius: 16px; padding: 1.1rem 1rem;
  display: flex; flex-direction: column; gap: 0.2rem; min-height: 84px; justify-content: center;
}
.quick a .quick__t { font-weight: 700; }
.quick a .quick__d { font-size: 0.78rem; color: var(--ink-50); }
.quick a.quick--solid { background: var(--black); color: var(--white); }
.quick a.quick--solid .quick__d { color: rgba(255,255,255,0.6); }

.alert {
  display: flex; gap: 0.6rem; align-items: flex-start;
  border-radius: 14px; padding: 0.9rem 1rem; margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert--issue { background: var(--red-bg); color: var(--red); }
.alert--ok { background: var(--green-bg); color: var(--green); }
.alert b { font-weight: 700; }

/* ---------- checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.4rem 0 1.2rem; }
.check {
  display: flex; align-items: center; gap: 0.9rem;
  border: 1.5px solid var(--ink-12); border-radius: 14px;
  padding: 0.85rem 1rem; min-height: 60px;
  cursor: pointer; user-select: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  border: 2px solid var(--ink-30); background: var(--white);
  display: grid; place-items: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.check__box svg { width: 18px; height: 18px; opacity: 0; transform: scale(0.6); transition: opacity 0.18s ease, transform 0.18s ease; stroke: var(--white); }
.check__label { font-weight: 500; }
.check input:checked + .check__box { background: var(--green); border-color: var(--green); }
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.check:has(input:checked) { border-color: var(--green); background: var(--green-bg); }
.check input:focus-visible + .check__box { outline: 2px solid var(--black); outline-offset: 2px; }

/* ---------- temp row + warning ---------- */
.temps { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.warn {
  margin-top: 0.9rem; border-radius: 14px; padding: 0.9rem 1rem;
  background: var(--red-bg); color: var(--red); font-size: 0.9rem; font-weight: 500;
  display: flex; gap: 0.55rem; align-items: flex-start;
}
.warn b { font-weight: 700; }

.form__actions { margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; }

/* ---------- records table ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-bottom: 1rem; }
.filters .field--wide { grid-column: 1 / -1; }
.records-wrap { overflow-x: auto; border: 1px solid var(--ink-12); border-radius: 14px; }
table.records { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 620px; }
table.records th, table.records td { padding: 0.7rem 0.8rem; text-align: left; border-bottom: 1px solid var(--ink-06); vertical-align: top; }
table.records th { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-50); background: var(--snow); position: sticky; top: 0; }
table.records tr:last-child td { border-bottom: 0; }
table.records .t-type { text-transform: capitalize; font-weight: 600; }
table.records .t-temp { font-variant-numeric: tabular-nums; }
table.records .t-over { color: var(--red); font-weight: 700; }
.records__top { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.records__count { font-size: 0.8rem; color: var(--ink-50); }
.empty { text-align: center; color: var(--ink-50); padding: 2.5rem 1rem; }

/* settings */
.set-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.3rem 0 0.8rem; }
.set-item { display: flex; gap: 0.5rem; align-items: center; }
.set-item input { flex: 1; }
.set-item .btn { min-height: 44px; flex: none; }
.sub-label { font-family: var(--display); text-transform: uppercase; font-size: 0.95rem; font-weight: 800; margin: 1.2rem 0 0.4rem; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(8px);
  z-index: 60; max-width: 90vw;
  background: var(--black); color: var(--white);
  padding: 0.85rem 1.2rem; border-radius: 12px; font-size: 0.9rem; font-weight: 500;
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.5);
}
.toast.is-on { opacity: 1; transform: translateX(-50%); }
.toast.is-err { background: var(--red); }

/* login extras */
.btn--google { background: #fff; border: 1.5px solid var(--ink-12); color: var(--black); }
.login__note { font-size: 0.78rem; color: var(--ink-30); margin-top: 0.7rem; line-height: 1.5; }

/* drawer dividers */
.drawer__div { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-30); padding: 1rem 1rem 0.3rem; }

/* ---------- safety manual ---------- */
.man-actions { margin-bottom: 1rem; }
.man-sec { padding: 1.2rem 0; border-top: 1px solid var(--ink-06); }
.man-sec:first-child { border-top: 0; padding-top: 0.2rem; }
.man-h {
  font-family: var(--display); text-transform: uppercase; font-size: 1.05rem; font-weight: 800;
  letter-spacing: 0.01em; display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.6rem;
}
.man-n { font-family: var(--body); font-size: 0.72rem; font-weight: 700; color: var(--ink-30); flex: none; }
.man-sub { font-size: 0.95rem; font-weight: 700; margin: 0.9rem 0 0.3rem; }
.manual p { color: var(--ink-70); margin-bottom: 0.6rem; line-height: 1.62; }
.man-list, .man-steps { margin: 0 0 0.7rem; padding-left: 1.25rem; color: var(--ink-70); }
.man-list li, .man-steps li { margin-bottom: 0.3rem; line-height: 1.5; }
.man-foot { color: var(--ink-30); font-size: 0.8rem; margin-top: 1.6rem; text-align: center; }

/* ---------- training ---------- */
.ring {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.76rem; font-weight: 700; color: var(--black);
  background:
    radial-gradient(closest-side, #fff 71%, transparent 72%),
    conic-gradient(var(--green) calc(var(--p, 0) * 1%), var(--ink-12) 0);
}
.train {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  border: 1.5px solid var(--ink-12); border-radius: 14px; padding: 0.85rem 1rem; min-height: 64px;
}
.train.is-done { border-color: var(--green); background: var(--green-bg); }
.train__main { display: flex; align-items: center; gap: 0.9rem; }
.train__box {
  width: 30px; height: 30px; flex: none; border-radius: 9px; border: 2px solid var(--ink-30);
  display: grid; place-items: center;
}
.train.is-done .train__box { background: var(--green); border-color: var(--green); }
.train__box svg { width: 18px; height: 18px; stroke: #fff; }
.train__t { font-weight: 600; }
.train__read { font-size: 0.8rem; color: var(--ink-50); font-weight: 500; }

/* desktop */
@media (min-width: 720px) {
  .dash__grid { grid-template-columns: repeat(4, 1fr); }
  .quick { grid-template-columns: repeat(4, 1fr); }
}

/* print (Safety Manual → PDF) */
@media print {
  .bar, .drawer, .scrim, .toast, .back, .man-actions { display: none !important; }
  .app { padding-top: 0 !important; }
  .main { max-width: 100%; padding: 0; }
  .man-sec { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
