/* FieldTrack — field-equipment signage aesthetic.
   Condensed display type, mono for every piece of recorded data,
   safety orange reserved for the one action that matters. */

:root {
  --ink:      #0D1A21;
  --steel:    #35525F;
  --slate:    #6B8494;
  --mist:     #E6ECEC;
  --card:     #FFFFFF;
  --hivis:    #FF6B1A;
  --hivis-dk: #D95104;
  --ok:       #14795A;
  --alert:    #C22F2F;
  --amber:    #B87A00;
  --line:     rgba(13, 26, 33, .13);
  --line-hi:  rgba(13, 26, 33, .28);

  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 3px;
  --pad: 20px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 15px/1.55 var(--body);
  padding-bottom: env(safe-area-inset-bottom);
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.05;
  margin: 0;
  text-transform: uppercase;
}
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; letter-spacing: .06em; }

/* Eyebrow labels double as field-form captions. */
.eyebrow {
  font: 500 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 8px;
}

.muted { color: var(--slate); }
.mono  { font-family: var(--mono); }

/* ------------------------------------------------------------ top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: #fff;
  padding: 0 14px;
  min-height: 54px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; }
.brand__mark {
  width: 13px; height: 13px;
  background: var(--hivis);
  /* Chevron: the mark reads as a direction marker, not a generic dot. */
  clip-path: polygon(0 0, 60% 0, 100% 50%, 60% 100%, 0 100%, 40% 50%);
}
.brand__name { font-family: var(--display); font-size: 19px; letter-spacing: .04em; text-transform: uppercase; }
.brand__name em { font-style: normal; color: var(--hivis); }

.topnav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.topnav a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font: 600 12px/1 var(--body);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 9px 11px;
  border-radius: var(--r);
  white-space: nowrap;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,.09); }

.pip {
  background: var(--hivis);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  border-radius: 9px;
  padding: 1px 5px;
  margin-left: 5px;
}

.account { position: relative; }
.account summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; padding: 5px;
}
.account summary::-webkit-details-marker { display: none; }
.account__initials {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--hivis); color: #fff;
  display: grid; place-items: center;
  font: 600 13px var(--body);
}
.account__name { display: none; font-size: 13px; color: rgba(255,255,255,.85); }
.account__menu {
  position: absolute; right: 0; top: 42px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  min-width: 210px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(13,26,33,.22);
}
.account__meta { font: 400 11px/1.5 var(--mono); color: var(--slate); padding: 8px 10px; margin: 0; border-bottom: 1px solid var(--line); word-break: break-all; }
.account__menu a { display: block; padding: 9px 10px; text-decoration: none; color: var(--ink); font-size: 13px; border-radius: 2px; }
.account__menu a:hover { background: var(--mist); }

/* -------------------------------------------------------------- shell */
.shell { max-width: 1120px; margin: 0 auto; padding: var(--pad) 14px 60px; }
.shell--narrow { max-width: 460px; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 10px 16px; margin-bottom: 18px;
}
.page-head .spacer { margin-left: auto; }

/* ------------------------------------------------------------ flashes */
.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash {
  margin: 0; padding: 11px 14px;
  border-left: 3px solid var(--steel);
  background: var(--card);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 14px;
  word-break: break-word;
}
.flash--error   { border-left-color: var(--alert); }
.flash--success { border-left-color: var(--ok); }
.flash--info    { border-left-color: var(--steel); }

/* -------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card__head .spacer { margin-left: auto; }

.grid { display: grid; gap: 14px; }
@media (min-width: 860px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--stat { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 859px) { .grid--stat { grid-template-columns: repeat(2, 1fr); } }

/* Stat blocks: number in mono so it reads as instrument output. */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat__value { font: 600 30px/1 var(--mono); letter-spacing: -.02em; }
.stat__label { font: 500 11px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--slate); margin-top: 8px; }
.stat--alert .stat__value { color: var(--alert); }
.stat--ok    .stat__value { color: var(--ok); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13px/1 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 12px 18px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--hivis); border-color: var(--hivis); color: #fff; }
.btn--primary:hover { background: var(--hivis-dk); border-color: var(--hivis-dk); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 7px 11px; min-height: 34px; font-size: 11px; }
.btn--wide { width: 100%; }

/* The punch button is the whole point of the employee screen. */
.punch {
  width: 100%;
  min-height: 88px;
  font-family: var(--display);
  font-size: 27px;
  letter-spacing: .05em;
  gap: 14px;
}
.punch--end { background: var(--ink); border-color: var(--ink); }
.punch--end:hover { background: #06121a; }

/* -------------------------------------------------------------- forms */
.field { margin-bottom: 14px; }
.field > label,
.field-label {
  display: block;
  font: 500 11px/1 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=password],
.field input[type=time],
.field input[type=date],
.field select,
.field textarea {
  width: 100%;
  font: 400 16px var(--body);
  padding: 11px 12px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--hivis);
  outline-offset: 1px;
  border-color: var(--hivis);
}
.hint { font-size: 12px; color: var(--slate); margin: 6px 0 0; }

.daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.daypick input { position: absolute; opacity: 0; pointer-events: none; }
.daypick label {
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  padding: 8px 12px;
  font: 600 12px var(--mono);
  cursor: pointer;
  user-select: none;
}
.daypick input:checked + label { background: var(--ink); color: #fff; border-color: var(--ink); }
.daypick input:focus-visible + label { outline: 2px solid var(--hivis); outline-offset: 1px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > .field { flex: 1 1 150px; margin-bottom: 0; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--hivis); }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  font: 500 10px/1 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-hi);
  white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F7F9F9; }
td.num, th.num { font-family: var(--mono); white-space: nowrap; }

.person { display: flex; align-items: center; gap: 10px; }
.person__name { font-weight: 600; }
.person__code { font: 400 11px var(--mono); color: var(--slate); }

/* --------------------------------------------------------- indicators */
.tag {
  display: inline-block;
  font: 600 10px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 2px;
  border: 1px solid var(--line-hi);
  white-space: nowrap;
}
.tag--complete { background: rgba(20,121,90,.11); color: var(--ok); border-color: rgba(20,121,90,.32); }
.tag--open     { background: rgba(184,122,0,.12); color: var(--amber); border-color: rgba(184,122,0,.34); }
.tag--absent   { background: rgba(194,47,47,.1); color: var(--alert); border-color: rgba(194,47,47,.3); }
.tag--off      { background: transparent; color: var(--slate); }
.tag--start    { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag--interval { background: transparent; color: var(--steel); }
.tag--end      { background: rgba(255,107,26,.14); color: var(--hivis-dk); border-color: rgba(255,107,26,.4); }

/* ------------------------------------------- signature: the shift rail */
/* A vertical rail of stamped punch tickets — the day's paper trail. */
.rail { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.rail::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: repeating-linear-gradient(var(--line-hi) 0 4px, transparent 4px 8px);
}
.rail__item { position: relative; padding: 0 0 16px; }
.rail__item:last-child { padding-bottom: 0; }
.rail__item::before {
  content: ""; position: absolute; left: -24px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--steel);
}
.rail__item--start::before { background: var(--ink); border-color: var(--ink); }
.rail__item--end::before   { background: var(--hivis); border-color: var(--hivis); }

.ticket {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px;
}
.ticket__shot {
  width: 62px; height: 62px; flex: none;
  object-fit: cover; border-radius: 2px;
  background: var(--mist);
  border: 1px solid var(--line);
}
.ticket__body { min-width: 0; flex: 1; }
.ticket__time { font: 600 19px/1 var(--mono); letter-spacing: -.02em; }
.ticket__meta { font: 400 11px/1.6 var(--mono); color: var(--slate); word-break: break-all; margin: 5px 0 0; }
.ticket__meta a { color: var(--steel); }

/* ------------------------------------------------- next-punch callout */
.due {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line-hi);
  border-left: 4px solid var(--steel);
  border-radius: var(--r);
  background: var(--card);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.due--overdue { border-left-color: var(--alert); background: rgba(194,47,47,.05); }
.due--clear   { border-left-color: var(--ok); }
.due__time { font: 600 27px/1 var(--mono); letter-spacing: -.02em; }
.due__text { font-size: 13px; color: var(--steel); }

/* -------------------------------------------------------- capture pane */
.capture {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6,14,18,.94);
  display: none;
  flex-direction: column;
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.capture[open], .capture.is-open { display: flex; }
.capture__head { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 12px; }
.capture__head h2 { color: #fff; }
.capture__close {
  margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.35);
  color: #fff; border-radius: var(--r); width: 38px; height: 38px; font-size: 19px; cursor: pointer;
}
.capture__stage {
  position: relative; flex: 1; min-height: 0;
  border-radius: var(--r); overflow: hidden;
  background: #000; display: grid; place-items: center;
}
.capture__stage video, .capture__stage img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.capture__stage video { transform: scaleX(-1); }   /* mirror the front camera */
.capture__readout {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: rgba(6,14,18,.8);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r);
  color: #fff;
  font: 400 11px/1.7 var(--mono);
  padding: 9px 11px;
}
.capture__readout b { color: var(--hivis); font-weight: 600; }
.capture__actions { display: flex; gap: 10px; margin-top: 12px; }
.capture__actions .btn { flex: 1; }
.capture__note {
  width: 100%; margin-top: 10px; padding: 11px 12px;
  border-radius: var(--r); border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.07); color: #fff;
  font: 400 15px var(--body);
}
.capture__note::placeholder { color: rgba(255,255,255,.5); }
.capture__error {
  color: #fff; background: var(--alert);
  border-radius: var(--r); padding: 10px 12px;
  font-size: 13px; margin-top: 10px; display: none;
}
.capture__error.is-shown { display: block; }

/* --------------------------------------------------------- auth pages */
body.authpage { background: var(--ink); min-height: 100dvh; }
body.authpage .shell { max-width: 404px; padding-top: 7vh; }
.auth__brand { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; }
.auth__brand .brand__name { color: #fff; font-size: 27px; font-family: var(--display); letter-spacing: .04em; text-transform: uppercase; }
.auth__brand .brand__name em { font-style: normal; color: var(--hivis); }
.auth__card { background: var(--card); border-radius: var(--r); padding: 24px; }
.auth__strap { font-size: 13px; color: var(--slate); margin: 0 0 20px; }
.auth__foot { text-align: center; margin: 16px 0 0; font-size: 13px; color: rgba(255,255,255,.6); }
.auth__foot a { color: rgba(255,255,255,.82); }
.auth__code {
  font: 400 12px/1.7 var(--mono); color: #fff; word-break: break-all;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r); padding: 11px; margin-top: 14px;
}
.auth__code a { color: var(--hivis); }

/* ------------------------------------------------------------- misc */
.empty { text-align: center; padding: 44px 18px; color: var(--slate); }
.empty h3 { color: var(--ink); margin-bottom: 8px; }
.empty p { margin: 0 auto; max-width: 340px; font-size: 14px; }

.daybar { display: flex; align-items: center; gap: 8px; }
.daybar__label { font: 600 13px var(--mono); }

.linkish { background: none; border: none; padding: 0; color: var(--steel); text-decoration: underline; cursor: pointer; font: inherit; }
.inline-form { display: inline; }

@media (min-width: 720px) {
  :root { --pad: 28px; }
  .account__name { display: inline; }
  h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

:focus-visible { outline: 2px solid var(--hivis); outline-offset: 2px; }
