/* ==========================================================================
   QC mini-app - phone-first, standalone.
   Same visual doctrine as the portal (DESIGN.md): square, Archivo +
   JetBrains Mono, cyan-only accent, dark by default.

   Deliberately its own small stylesheet rather than the portal's app.css:
   this app's document root is qcapp/, so ../assets is not reachable over the
   qc subdomain - and a 4KB file over shop-floor mobile data beats a 32KB one
   carrying six widgets' worth of rules this app never uses.
   ========================================================================== */

:root {
  --bg:#141518; --surface:#212327; --header:#1C1D20; --tile:#26282D; --tile-hi:#2A2C31;
  --title:#FFFFFF; --body:#E8E6DF;
  --muted-65:rgba(232,230,223,0.65); --muted-45:rgba(232,230,223,0.45);
  --muted-30:rgba(232,230,223,0.30);
  --accent:#38B6D9; --accent-12:rgba(56,182,217,0.12); --accent-40:rgba(56,182,217,0.40);
  --on-accent:#08191F;
  --danger:#DC4438; --danger-12:rgba(220,68,56,0.12); --danger-40:rgba(220,68,56,0.40);
  --amber:#E47835; --amber-12:rgba(228,120,53,0.12); --amber-40:rgba(228,120,53,0.40);
  --line:rgba(255,255,255,0.10); --line-str:rgba(255,255,255,0.16);
  --line-soft:rgba(255,255,255,0.06);
  --top-hair:inset 0 1px 0 rgba(255,255,255,0.04);
  --sans:'Archivo',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
:root[data-theme="light"] {
  --bg:#EEEFF1; --surface:#FFFFFF; --header:#FFFFFF; --tile:#F4F5F7; --tile-hi:#EAECEF;
  --title:#101114; --body:#24262B;
  --muted-65:rgba(36,38,43,0.70); --muted-45:rgba(36,38,43,0.55); --muted-30:rgba(36,38,43,0.38);
  --accent:#0E7C9B; --accent-12:rgba(14,124,155,0.10); --accent-40:rgba(14,124,155,0.40);
  --on-accent:#FFFFFF;
  --danger:#C0392B; --danger-12:rgba(192,57,43,0.10); --danger-40:rgba(192,57,43,0.40);
  --amber:#B45A15; --amber-12:rgba(180,90,21,0.10); --amber-40:rgba(180,90,21,0.40);
  --line:rgba(16,17,20,0.14); --line-str:rgba(16,17,20,0.22); --line-soft:rgba(16,17,20,0.08);
  --top-hair:inset 0 1px 0 rgba(255,255,255,0.9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--body); font-family: var(--sans);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  /* Respect the notch / home indicator on iPhone. */
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--accent); text-decoration: none; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }

/* --- header --------------------------------------------------------------- */
header.qc {
  background: var(--header); border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
header.qc .brand { flex: 1; min-width: 0; }
header.qc .mark {
  font-weight: 900; font-size: 16px; letter-spacing: .02em; color: var(--title); line-height: 1;
}
header.qc .mark span { color: var(--muted-45); font-weight: 700; padding: 0 3px; }
header.qc .sub {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-45); margin-top: 4px;
}
.iconbtn {
  width: 42px; height: 42px; flex: none; background: var(--tile-hi);
  border: 1px solid var(--line-str); color: var(--body);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.iconbtn:active { transform: translateY(1px); }
.iconbtn.out { color: var(--muted-65); }

/* --- who / greeting ------------------------------------------------------- */
.who {
  padding: 18px 0 14px; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 12px;
}
.who h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--title); }
.who .d {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted-45); margin-bottom: 6px;
}
.who .mine { text-align: right; }
.who .mine .v { font-family: var(--mono); font-size: 20px; color: var(--accent); line-height: 1; }
.who .mine .k {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-45); margin-top: 4px;
}

/* --- card ----------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--top-hair); padding: 18px 16px; margin-bottom: 14px;
}
.card.accent { border-top: 2px solid var(--accent); }
h2.eyebrow {
  margin: 0 0 14px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; color: var(--body);
}

/* --- form ----------------------------------------------------------------- */
label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted-45); margin: 0 0 8px;
}
input[type=number], input[type=date], input[type=text], input[type=email],
input[type=password], textarea {
  width: 100%; padding: 14px; border-radius: 0;
  /* 16px minimum: anything smaller makes iOS Safari zoom on focus. */
  font-size: 16px; font-family: inherit;
  border: 1px solid var(--line-str); background: var(--tile); color: var(--body);
}
input:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-12);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.field { margin-bottom: 18px; }

/* Hour presets - the whole point of the app. A shop-floor session is almost
   always a round number, so tapping a chip should be the fast path and the
   keyboard the exception. */
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.chip-h {
  border: 1px solid var(--line-str); background: var(--tile); color: var(--body);
  font-family: var(--mono); font-size: 15px; font-weight: 500;
  min-height: 52px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 120ms, background 120ms, color 120ms;
}
.chip-h:active { transform: translateY(1px); }
.chip-h.on {
  border-color: var(--accent); background: var(--accent-12); color: var(--accent);
}

button.go {
  width: 100%; min-height: 54px; border-radius: 0; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
button.go:active { transform: translateY(1px); }
button.go[disabled] { opacity: .5; }

/* --- notices -------------------------------------------------------------- */
.notice {
  padding: 12px 14px; font-size: 13.5px; line-height: 1.5; margin-bottom: 14px;
  border: 1px solid var(--accent-40); border-left-width: 3px;
  background: var(--accent-12); color: var(--body);
}
.notice.err  { border-color: var(--danger-40); background: var(--danger-12); }
.notice.warn { border-color: var(--amber-40);  background: var(--amber-12); }

/* --- recent list ---------------------------------------------------------- */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; }
.recent li:last-child { border-bottom: none; }
.recent .h {
  font-family: var(--mono); font-size: 15px; color: var(--accent); flex: none;
  min-width: 52px;
}
.recent .b { min-width: 0; }
.recent .n { font-size: 13.5px; color: var(--body); line-height: 1.4; }
.recent .m { font-size: 11px; color: var(--muted-45); margin-top: 3px; font-family: var(--mono); }
.empty { color: var(--muted-45); font-size: 13px; padding: 16px 0; text-align: center; }

/* --- footer link to the full portal --------------------------------------- */
.deeper {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 16px; margin-top: 4px; color: var(--body);
}
.deeper .t { font-size: 13.5px; font-weight: 700; color: var(--title); }
.deeper .s { font-size: 11.5px; color: var(--muted-45); margin-top: 2px; }
.deeper:active { border-color: var(--accent); }

.foot {
  text-align: center; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted-30);
  padding: 22px 0 8px;
}

/* --- login ---------------------------------------------------------------- */
.gate { min-height: 88vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gatecard {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--top-hair);
  padding: 30px 22px; width: 100%; max-width: 380px; text-align: center;
}
.gatecard .mark { font-size: 19px; font-weight: 900; color: var(--title); }
.gatecard .mark span { color: var(--muted-45); font-weight: 700; padding: 0 3px; }
.gatecard .sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted-45); margin: 6px 0 24px;
}
.gatecard .field { text-align: left; }

/* Wider screens: it still works, it just doesn't sprawl. */
@media (min-width: 620px) {
  .wrap { padding-top: 6px; }
  .chips { grid-template-columns: repeat(8, 1fr); }
}
