/* =============================================================================
   Anchor Foods Safety - base styling (B1)
   Big, touch-friendly controls for shop-floor kiosk use.
   ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #eef1f5; color: #1b1f24; font-size: 16px; line-height: 1.4;
}

/* ---- Top bar + nav -------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #1c4f8b; color: #fff; padding: 12px 20px;
  flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; font-size: 18px; }
.mainnav { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.mainnav a {
  color: #fff; text-decoration: none; padding: 10px 16px;
  border-radius: 6px; font-weight: 600;
}
.mainnav a:hover { background: rgba(255,255,255,.15); }
.mainnav a.active { background: #1f4e79; color: #fff; border-radius: 4px; font-weight: 700; }
.req { color: #b0160f; font-weight: 700; }
.bad { color: #b0160f; }
.userbox { display: flex; align-items: center; gap: 12px; }
.userbox .who { font-size: 14px; opacity: .9; }

/* ---- Content -------------------------------------------------------------- */
.content { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 24px; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 0 0 14px; }

.card {
  background: #fff; border: 1px solid #d8dee6; border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}

/* ---- Buttons (big + touch-friendly) -------------------------------------- */
.btn {
  display: inline-block; background: #1c4f8b; color: #fff; border: 0;
  padding: 12px 20px; border-radius: 8px; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: #163f70; }
.btn-big { padding: 18px 28px; font-size: 20px; width: 100%; margin-top: 12px; }
.btn-small { padding: 8px 12px; font-size: 14px; }
.btn-warn { background: #a3401c; }
.btn-warn:hover { background: #822f12; }

/* ---- Forms ---------------------------------------------------------------- */
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=datetime-local], input[type=number], input[type=file], textarea, select {
  display: block; width: 100%; padding: 12px; font-size: 16px;
  border: 1px solid #b9c2cd; border-radius: 8px; margin-top: 4px; background:#fff;
}
textarea { min-height: 80px; resize: vertical; }
.rowform { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.rowform label { flex: 1 1 180px; margin-bottom: 0; }
.rowform .btn { flex: 0 0 auto; }
label.chk { display: flex; align-items: center; gap: 8px; }
label.chk input { width: auto; margin: 0; }
form.inline { display: inline; }

.bigfield { font-size: 22px !important; padding: 18px !important; text-align: center; }
.loginwrap { max-width: 440px; margin: 0 auto; }

/* ---- Tables --------------------------------------------------------------- */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid #e3e8ee; font-size: 14px;
}
table.grid thead th { background: #f3f6fa; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
table.grid td.actions { white-space: nowrap; }
table.grid td.actions .btn, table.grid td .btn { margin-right: 4px; }
.privgrid td, .privgrid th { padding: 6px 10px; }
.privgrid tr.cathead td { background: #eef1f5; font-weight: 700; text-transform: capitalize; }

table.kv th { text-align: left; padding: 6px 16px 6px 0; color: #555; font-weight: 600; }
table.kv td { padding: 6px 0; }

/* ---- Tiles (dashboard stub) ---------------------------------------------- */
.tilegrid { display: flex; flex-wrap: wrap; gap: 16px; }
.tile {
  display: flex; align-items: center; justify-content: center;
  min-width: 180px; min-height: 90px; background: #1c4f8b; color: #fff;
  border-radius: 12px; font-size: 18px; font-weight: 700; text-decoration: none;
  padding: 16px; text-align: center;
}
.tile:hover { background: #163f70; }

/* ---- Notices -------------------------------------------------------------- */
.notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.notice-ok   { background: #e4f4e6; border: 1px solid #a6d9ad; color: #1d5b29; }
.notice-err  { background: #fbe4e2; border: 1px solid #e3a69c; color: #7a241a; }
.notice-info { background: #e3eefb; border: 1px solid #a7c4ea; color: #1b3f6b; }

.muted { color: #6b7681; font-size: 13px; }
code { background: #f0f3f7; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* ---- Footer build stamp --------------------------------------------------- */
.buildstamp {
  max-width: 1100px; margin: 24px auto; padding: 16px 20px;
  color: #8894a1; font-size: 12px; border-top: 1px solid #d8dee6;
}
.backtop {
  position: fixed; right: 18px; bottom: 18px; z-index: 20;
  border: 0; border-radius: 8px; padding: 12px 14px;
  background: #1b1f24; color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
}
.backtop.show { opacity: .92; pointer-events: auto; transform: translateY(0); }
.backtop:hover { opacity: 1; }
