/* Real Seal field time clock - mobile first.
   Big touch targets throughout: this gets used outdoors, in gloves. */

:root {
  --teal: #0f6b78;
  --teal-dark: #0b4f59;
  --teal-tint: #e6f1f3;
  --slate: #1f2a30;
  --slate-2: #34434c;
  --ink: #17242b;
  --muted: #5d7079;
  --line: #dde5e8;
  --bg: #f4f7f8;
  --card: #ffffff;
  --green: #1c7a4a;
  --green-tint: #e4f4ec;
  --amber: #a86a00;
  --amber-tint: #fdf2df;
  --red: #ad2831;
  --red-tint: #fbe9ea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 36, 43, .06), 0 4px 14px rgba(23, 36, 43, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------- shell ---------- */

header.topbar {
  background: var(--slate);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { font-weight: 600; letter-spacing: .01em; }
.topbar .brand small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: #a9bcc4;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; color: #cfdde2; text-align: right; }
.topbar .who b { display: block; color: #fff; }

.mode-chip {
  font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.mode-chip.mock { background: var(--amber-tint); color: var(--amber); border-color: #eccf9a; }
.mode-chip.live { background: var(--green-tint); color: var(--green); border-color: #a8d8bf; }

main { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 19px; }
.card h2 + p.sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.card > p.sub:first-child { margin-top: 0; }

h3.section-head {
  margin: 26px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--teal);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

/* ---------- buttons ---------- */

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 12px 16px;
  min-height: 48px;
}
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 600;
  width: 100%;
  font-size: 17px;
  min-height: 56px;
}
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }

.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
  width: 100%;
  font-size: 17px;
  min-height: 56px;
}

.btn-ghost { background: #fff; color: var(--teal); border-color: #bcd4d8; font-weight: 600; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > * { flex: 1; min-width: 140px; }

/* ---------- sign in ---------- */

.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.employee-grid button { text-align: left; font-weight: 500; }
.employee-grid button.selected {
  border-color: var(--teal);
  background: var(--teal-tint);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pinpad button { font-size: 22px; font-weight: 600; min-height: 62px; font-family: "IBM Plex Mono", monospace; }
.pin-display {
  font: 600 30px/1 "IBM Plex Mono", monospace;
  letter-spacing: .38em;
  text-align: center;
  padding: 16px 0;
  color: var(--teal);
  min-height: 62px;
}

/* ---------- status ---------- */

.status-banner {
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid;
}
.status-banner.out { background: #fff; border-color: var(--line); }
.status-banner.in { background: var(--green-tint); border-color: #a8d8bf; }
.status-banner .label {
  font: 600 11px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.status-banner .big { font-size: 24px; font-weight: 600; margin: 6px 0 2px; }
.status-banner .meta { color: var(--muted); font-size: 14px; }
.elapsed { font: 600 34px/1 "IBM Plex Mono", monospace; color: var(--green); margin: 10px 0 0; }

.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-list button { text-align: left; padding: 14px; display: block; }
.job-list button .jname { font-weight: 600; display: block; }
.job-list button .jmeta { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.job-list button.selected { border-color: var(--teal); background: var(--teal-tint); box-shadow: inset 0 0 0 1px var(--teal); }

/* ---------- forms ---------- */

.item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .q { font-weight: 500; margin-bottom: 4px; }
.item .q .req { color: var(--red); margin-left: 3px; }
.item .hint { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

.choices { display: flex; gap: 8px; margin-top: 8px; }
.choices button { flex: 1; font-weight: 600; min-height: 52px; }
.choices button[aria-pressed="true"][data-v="yes"] { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.choices button[aria-pressed="true"][data-v="no"] { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.choices button[aria-pressed="true"][data-v="na"] { background: #eef2f4; border-color: var(--slate-2); color: var(--slate-2); }

input[type="text"], textarea, select {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-height: 48px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }

.note-wrap { margin-top: 10px; }
.note-wrap label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 5px;
}

.tickrow { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.tickrow input[type="checkbox"] { width: 26px; height: 26px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--teal); }

/* hazard grid */
.hazard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.hazard.on { border-color: var(--amber); background: var(--amber-tint); }
.hazard .control-wrap { margin-top: 10px; }
.hazard .control-wrap label { display: block; font-size: 13px; font-weight: 600; color: var(--amber); margin-bottom: 5px; }

/* ---------- messages ---------- */

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 15px; border: 1px solid; }
.alert.err { background: var(--red-tint); border-color: #e2a9ad; color: #7d1d24; }
.alert.warn { background: var(--amber-tint); border-color: #eccf9a; color: #7a4d00; }
.alert.ok { background: var(--green-tint); border-color: #a8d8bf; color: #145c37; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert li { margin-bottom: 4px; }

.item.invalid { background: var(--red-tint); border-radius: 8px; padding: 12px; margin: 4px 0; border-bottom-color: transparent; }
.item .err-msg { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 6px; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 62%, rgba(244, 247, 248, 0));
  padding: 14px 0 18px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--slate);
  color: #fff;
  padding: 13px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  z-index: 60;
  max-width: 92vw;
  text-align: center;
  font-size: 15px;
}

/* ---------- supervisor ---------- */

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { padding: 9px 14px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tabs button.active { background: var(--teal); border-color: var(--teal); color: #fff; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 600 11px/1 "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
td.wrap, th.wrap { white-space: normal; min-width: 200px; }
tbody tr:hover { background: #fafcfc; }

.pill {
  display: inline-block;
  font: 600 11px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 8px;
  border-radius: 999px;
}
.pill.synced { background: var(--green-tint); color: var(--green); }
.pill.pending { background: var(--amber-tint); color: var(--amber); }
.pill.failed { background: var(--red-tint); color: var(--red); }
.pill.none { background: #eef2f4; color: var(--muted); }

.record-rows { margin-top: 10px; }
.record-rows .r { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.record-rows .r .rl { flex: 1; color: var(--ink); }
.record-rows .r .rv { font-weight: 600; white-space: nowrap; }
.record-rows .r .rn { flex-basis: 100%; color: var(--muted); font-size: 13px; font-style: italic; }
.record-rows .r.hasnote { flex-wrap: wrap; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mono { font-family: "IBM Plex Mono", monospace; }
.small { font-size: 13px; }

@media (min-width: 640px) {
  .btn-primary, .btn-danger { width: auto; min-width: 260px; }
}

/* ---------- multicheck ("check all that apply") ---------- */

.tickrow.checkrow {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  align-items: center;
}
.tickrow.checkrow.on { border-color: var(--teal); background: var(--teal-tint); }

/* ---------- prefilled fields ---------- */

input.prefilled, textarea.prefilled {
  background: #eef2f4;
  color: var(--muted);
  border-style: dashed;
  cursor: default;
}

/* ---------- repeating table (task-step breakdown) ---------- */

.grid-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fbfcfd;
}
.grid-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 11px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal);
  margin-bottom: 10px;
}
.row-remove {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  border-color: #e2a9ad;
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.grid-cell { margin-bottom: 10px; }
.grid-cell:last-child { margin-bottom: 0; }
.grid-cell > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.grid-cell.invalid {
  background: var(--red-tint);
  border-radius: 8px;
  padding: 8px;
  margin: 0 -8px 10px;
}
.grid-cell.invalid > label { color: var(--red); }
button.add-row { width: 100%; margin-top: 4px; }

@media (min-width: 640px) {
  .grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .grid-row-head { grid-column: 1 / -1; }
}

/* ---------- site assessment state ---------- */

.site-state { margin-top: 14px; }
.site-state .alert { margin-bottom: 0; }
.alert.ok { background: var(--green-tint); border-color: #a8d8bf; color: #12603a; }
.alert.info { background: var(--teal-tint); border-color: #a9cdd4; color: #0b4f59; }
.alert .sub { font-size: 13px; opacity: .85; margin-top: 4px; }

.card.assessment { background: #fbfcfd; }
.card.assessment .record-rows { margin-top: 10px; }
.signed-by {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* PPE the job itself requires */
.tickrow.checkrow.locked { background: #eef2f4; border-style: dashed; }
.tickrow.checkrow.locked input { accent-color: var(--muted); }
.lock-tag {
  display: block;
  font: 600 11px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- menu tiles ---------- */

.tile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  min-height: 84px;
}
.tile:last-child { margin-bottom: 0; }
.tile:hover { border-color: var(--teal); }
.tile-title {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 3px;
}
.tile-sub { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.tile.live { border-color: var(--green); background: var(--green-tint); }
.tile.live .tile-title { color: var(--green); }

/* ---------- schedule ---------- */

.card.today { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.daylabel {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 600 12px/1 "IBM Plex Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  padding-bottom: 9px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.todaytag {
  font-size: 10px;
  background: var(--teal);
  color: #fff;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: .06em;
}
.shift { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.shift:last-child { border-bottom: none; padding-bottom: 0; }
.shift-time {
  font: 600 13px/1.4 "IBM Plex Mono", monospace;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.shift-job { font-weight: 600; line-height: 1.3; }
.shift-meta { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }
.shift.other { opacity: .62; }
.tag {
  display: inline-block;
  margin-top: 5px;
  font: 600 10px/1 "IBM Plex Mono", monospace;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 6px;
  border-radius: 4px;
}

/* ---------- break state ---------- */

.status-banner.break { background: var(--amber-tint); border-color: #eccf9a; }
.status-banner.break .label { color: var(--amber); }

.btn-big {
  min-height: 66px;
  font-size: 17px;
  font-weight: 600;
  color: var(--teal);
  border-color: #bcd4d8;
}
.btn-big:hover { background: var(--teal-tint); }

/* ---------- numbers ---------- */

.numrow { display: flex; align-items: center; gap: 10px; }
.numrow input {
  flex: 1;
  font: 600 20px/1 "IBM Plex Mono", monospace;
  min-height: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.numrow .unit {
  font: 600 13px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  min-width: 70px;
}

/* ---------- photos ---------- */

.photos { margin-top: 10px; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-strip:not(:empty) { margin-bottom: 8px; }
.photo { position: relative; width: 84px; height: 84px; }
.photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}
.photo-x {
  position: absolute;
  top: -7px; right: -7px;
  width: 24px; height: 24px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--slate);
  color: #fff;
  border: none;
  font-size: 15px;
  line-height: 1;
}
button.photo-add { width: 100%; }

/* ---------- alerts ---------- */

.alert-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.alert-row:last-child { border-bottom: none; }
.alert-row > div:first-child { flex: 1; min-width: 0; }
.alert-row button { width: auto; flex: none; min-height: 40px; padding: 8px 12px; font-size: 13px; }
.alert-title { font-weight: 600; line-height: 1.35; }
.alert-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.alert-detail {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
}
.sev {
  font: 600 10px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.sev.urgent { background: var(--red-tint); color: var(--red); }
.sev.warning { background: var(--amber-tint); color: var(--amber); }
.sev.info { background: var(--teal-tint); color: var(--teal); }

/* ---------- job profile editor ---------- */

.profile-head { width: 100%; text-align: left; display: block; }
.profile-form { margin-top: 14px; display: flex; flex-direction: column; gap: 18px; }
.pf > label {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 3px;
}
.pf .hint { margin-bottom: 7px; }
.picklist { display: flex; flex-direction: column; gap: 6px; }
.picklist .tickrow { padding: 9px 11px; font-size: 14px; }
.editrow { display: flex; gap: 7px; margin-bottom: 7px; align-items: center; }
.editrow input { flex: 1; min-width: 0; min-height: 44px; }
.editrow .row-remove {
  flex: none;
  width: 40px;
  min-height: 44px;
  padding: 0;
  font-size: 18px;
}

/* three mid-shift actions side by side, still thumb-sized */
.btn-row.three > * { min-width: 0; flex: 1 1 30%; }
.btn-row.three .btn-big { font-size: 16px; padding: 12px 8px; }

/* ---------- correcting a punch ---------- */

.small-btn { width: auto; min-height: 36px; padding: 6px 12px; font-size: 13px; }
tr.edit-row > td { background: var(--sunken); padding: 0; }
.fixer { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.fixer-head {
  font: 600 11px/1 "IBM Plex Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
}
.fixer input[type="text"] { font-family: "IBM Plex Mono", monospace; }
.fixer-history { border-top: 1px solid var(--line); padding-top: 12px; }
.fixer-history:empty { display: none; }
.fix-line {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 0;
  line-height: 1.45;
}

/* the real tap time, where rounding moved the payroll start */
.actual {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 2px;
}

/* changing your own PIN */
.pinform { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.pinform input {
  font: 600 22px/1 "IBM Plex Mono", monospace;
  letter-spacing: .3em;
  text-align: center;
  min-height: 54px;
}

/* the pickup slip thumbnail in the material log */
td .photo-thumb, td img { max-width: 56px; border-radius: 6px; display: block; }

/* top bar buttons: the menu is reachable from anywhere once signed in */
.topbtn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
#menuBtn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
}
#menuBtn:hover { background: rgba(255, 255, 255, .12); }

.tile.onbreak { border-color: var(--amber); background: var(--amber-tint); }
.tile.onbreak .tile-title { color: var(--amber); }

/* The job list: a row is a site and what you can do to it. */
.joblist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.joblist-row:last-child { border-bottom: 0; }
.joblist-name { font-weight: 600; }
.joblist-meta { color: var(--muted); font-size: 0.85rem; }
.joblist-row.stray { flex-wrap: wrap; }
.joblist-row.stray select { flex: 1 1 160px; }
.warn-card { border-left: 4px solid var(--warn, #c77700); }
