/* CDS Daily Jobsite Report - built for a phone held in one hand, in the sun, with gloves on.
   Everything is sized for a thumb: 48px minimum targets, high contrast, no hover-only state. */

:root {
  --navy: #11314f;
  --navy-d: #0b2338;
  --ink: #16202b;
  --muted: #5d6b7a;
  --line: #d2dae2;
  --bg: #f4f6f8;
  --card: #ffffff;
  --accent: #c8102e;
  --ok: #1d7a44;
  --warn: #a8630a;
  --radius: 10px;
  --tap: 48px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* 16px is deliberate: anything smaller makes iOS zoom the page on focus. */
input, select, textarea, button { font: inherit; }

.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark {
  font-weight: 800; letter-spacing: .08em; font-size: 15px;
  border: 2px solid #fff; border-radius: 3px; padding: 2px 7px; flex: none;
}
.brandtext { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.net { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; flex: none; }
.net.on  { background: rgba(255,255,255,.16); color: #cfe8d8; }
.net.off { background: #f3c33c; color: #3a2a00; }

.queuebar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #fff5d6; color: #5a4300;
  border-bottom: 1px solid #e8d79a; font-size: 14px;
}
/* display:flex beats the hidden attribute, so say it explicitly. */
[hidden] { display: none !important; }
.linkbtn {
  background: none; border: 0; color: var(--navy); font-weight: 700;
  text-decoration: underline; padding: 8px; min-height: var(--tap); cursor: pointer;
}

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

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 18px; color: var(--navy); }
.sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

.f { display: block; margin-bottom: 16px; }
.f:last-child { margin-bottom: 0; }
.lab { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.lab em { color: var(--accent); font-style: normal; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.hint-inline { font-weight: 400; color: var(--muted); font-size: 12.5px; }

input[type=text], input[type=date], select, textarea {
  width: 100%; padding: 12px; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(17,49,79,.25); border-color: var(--navy);
}

.row2 { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; gap: 14px; } }

/* --- subcontractor blocks --- */
.sub-block {
  border: 1px solid var(--line); border-left: 4px solid var(--navy);
  border-radius: 8px; padding: 14px; margin-bottom: 14px; background: #fbfcfd;
}
.sub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sub-n { font-weight: 700; color: var(--navy); }
.remove {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--accent); padding: 8px 12px; min-height: 40px; cursor: pointer;
}

/* Work items are chips, not a dropdown: a dropdown hides what you already picked,
   and on a multi-select that is exactly the thing you need to see. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 9px 13px; min-height: 42px; cursor: pointer; font-size: 14px;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .code { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on .code { color: #b9ccdd; }
.chips .empty { color: var(--muted); font-size: 14px; }

/* --- photos --- */
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.photos:empty { display: none; }
.thumb { position: relative; width: 78px; height: 78px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 26px; height: 26px;
  border-radius: 99px; border: 0; background: rgba(0,0,0,.65); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.photorow { display: flex; flex-wrap: wrap; gap: 10px; }
.photorow .photobtn { flex: 1 1 auto; }
.photobtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 12px 18px; border: 1px dashed var(--navy);
  border-radius: 8px; color: var(--navy); font-weight: 600; cursor: pointer;
}

/* --- actions --- */
.actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
@media (min-width: 560px) { .actions { flex-direction: row-reverse; } .actions button { flex: 1; } }
button.primary {
  background: var(--navy); color: #fff; border: 0; border-radius: 8px;
  padding: 16px; min-height: 54px; font-weight: 700; font-size: 17px; cursor: pointer;
}
button.primary:disabled { background: var(--muted); }
button.ghost {
  background: #fff; color: var(--navy); border: 1px solid var(--navy);
  border-radius: 8px; padding: 14px; min-height: var(--tap); font-weight: 600; cursor: pointer;
}
#addsub { width: 100%; }
.foot { text-align: center; color: var(--muted); font-size: 13.5px; min-height: 20px; }
.foot.ok   { color: var(--ok); font-weight: 600; }
.foot.warn { color: var(--warn); font-weight: 600; }

@media (prefers-color-scheme: dark) {
  :root { --bg:#10161d; --card:#18212b; --ink:#e8edf2; --line:#2d3b4a; --muted:#93a3b4; }
  input[type=text], input[type=date], select, textarea { background: #0f1720; color: var(--ink); }
  .sub-block { background: #141d26; }
  .chip { background: #0f1720; }
  button.ghost { background: #18212b; color: #cfe0f0; border-color: #4a6380; }
}
