/* ==========================================================================
   S16 crew mobile field capture (Mockup 5, wave 2) - phone prototype.
   Self-contained DataRipple mobile look (red #CC0C1F on light, navy chrome,
   Ubuntu). Review page shows a phone frame; the crew screens live inside it.
   Review-only mockup.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
  --brand: #CC0C1F; --brand-deep: #A80917; --brand-subtle: rgba(204,12,31,0.08);
  --navy: #1B2433; --ink: #18293B; --ink-1: #0B1220; --mut: #5A6B7B;
  --bg: #eef2f7; --card: #fff; --line: #e4e9f0; --sky: #5189AD;
  --ok: #166534; --ok-soft: rgba(22,101,52,0.10); --warn: #854D0E; --warn-soft: rgba(133,77,14,0.10);
  --danger: #991B1B; --danger-soft: rgba(153,27,27,0.10);
}
* { box-sizing: border-box; }

/* review page ---------------------------------------------------------- */
.stage { min-height: calc(100vh - 52px); display: flex; gap: 40px; align-items: center; justify-content: center;
  padding: 34px 26px; background: radial-gradient(1200px 600px at 50% -10%, #f6f8fb, #e7edf4); flex-wrap: wrap; }
.legend { max-width: 320px; }
.legend .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.legend h2 { font-family: "Ubuntu", sans-serif; font-size: 24px; line-height: 1.2; color: var(--ink-1); margin: 8px 0 12px; }
.legend p { font-size: 14px; color: var(--ink); line-height: 1.6; margin: 0 0 14px; }
.legend .pt { display: flex; gap: 10px; font-size: 13px; color: var(--mut); margin-bottom: 9px; line-height: 1.45; }
.legend .pt b { color: var(--ink-1); }
.legend .pt .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 5px; flex-shrink: 0; }

/* phone frame ---------------------------------------------------------- */
.phone { width: 384px; height: 812px; background: var(--bg); border-radius: 46px; border: 13px solid var(--navy);
  box-shadow: 0 34px 90px rgba(16,26,40,0.28); position: relative; overflow: hidden; flex-shrink: 0;
  font-family: "Ubuntu", sans-serif; color: var(--ink); }
.notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 150px; height: 27px; background: var(--navy); border-radius: 0 0 18px 18px; z-index: 30; }
.statusbar { height: 44px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 6px; font-size: 13px; font-weight: 600; color: var(--ink-1); }
.statusbar .sb-r { display: inline-flex; gap: 6px; align-items: center; }
.statusbar .sb-r i { width: 16px; height: 10px; border-radius: 2px; background: var(--ink-1); display: inline-block; opacity: .85; }

.screens { position: absolute; top: 44px; bottom: 62px; left: 0; right: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.on { display: flex; }
.screen::-webkit-scrollbar { display: none; }

.app-head { padding: 8px 20px 10px; }
.app-head .greet { font-size: 21px; font-weight: 700; color: var(--ink-1); letter-spacing: -.01em; }
.app-head .sub { font-size: 13px; color: var(--mut); margin-top: 1px; }
.app-head .av { position: absolute; top: 52px; right: 20px; width: 38px; height: 38px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.app-body { padding: 4px 16px 20px; }

/* geofence banner */
.geo { display: flex; align-items: center; gap: 11px; margin: 4px 4px 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--ok-soft); border: 1px solid rgba(22,101,52,0.18); }
.geo.off { background: var(--danger-soft); border-color: rgba(153,27,27,0.2); }
.geo .gi { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--ok); flex-shrink: 0; }
.geo.off .gi { color: var(--danger); }
.geo .gt { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.geo .gs { font-size: 12px; color: var(--mut); margin-top: 1px; }

/* cards */
.card { background: var(--card); border-radius: 16px; box-shadow: 0 2px 10px rgba(16,26,40,0.05); padding: 15px 16px; margin: 0 4px 14px; }
.card .ck { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); }
.card .cttl { font-size: 16px; font-weight: 600; color: var(--ink-1); margin-top: 3px; }
.card .cmeta { font-size: 12.5px; color: var(--mut); margin-top: 4px; line-height: 1.5; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 11px; font-weight: 500; color: var(--ink); background: var(--bg); border-radius: 999px; padding: 4px 10px; }

/* clock button + shift */
.clockbtn { display: block; width: calc(100% - 8px); margin: 4px 4px 12px; border: none; border-radius: 16px; padding: 17px;
  font-family: inherit; font-size: 17px; font-weight: 700; color: #fff; background: var(--brand); cursor: pointer; letter-spacing: .01em;
  box-shadow: 0 8px 20px rgba(204,12,31,0.28); }
.clockbtn.out { background: var(--navy); box-shadow: 0 8px 20px rgba(27,36,51,0.28); }
.clockbtn .cbs { display: block; font-size: 12px; font-weight: 400; opacity: .8; margin-top: 2px; }
.shift { display: none; align-items: center; gap: 12px; margin: 0 4px 14px; padding: 13px 15px; border-radius: 14px; background: var(--brand-subtle); border: 1px solid rgba(204,12,31,0.15); }
.shift.on { display: flex; }
.shift .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-subtle); flex-shrink: 0; }
.shift .st { font-size: 13px; color: var(--ink); } .shift .st b { color: var(--ink-1); }
.shift .timer { margin-left: auto; font-size: 18px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

.shift-acts { display: none; gap: 8px; margin: -6px 4px 14px; }
.shift-acts.on { display: flex; }
.shift-acts button { flex: 1; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink-1); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.shift.brk .pulse { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.shift.brk .timer { color: var(--warn); }

.reportcard { display: flex; align-items: center; gap: 12px; margin: 16px 4px 6px; padding: 14px 15px; border-radius: 15px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(16,26,40,0.05); cursor: pointer; }
.reportcard .ri2 { width: 36px; height: 36px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.reportcard .rt2 { font-size: 14.5px; font-weight: 600; color: var(--ink-1); }
.reportcard .rs2 { font-size: 12px; color: var(--mut); margin-top: 1px; line-height: 1.35; }
.reportcard .chev { margin-left: auto; color: var(--mut); font-size: 16px; }
.catrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.cat { font-family: inherit; font-size: 13px; color: var(--ink-1); background: var(--bg); border: 1.5px solid transparent; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.cat.on { border-color: var(--brand); background: var(--brand-subtle); color: var(--brand); }
.jobpick { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.jobpick button { text-align: left; font-family: inherit; font-size: 14px; color: var(--ink-1); background: var(--bg); border: 1.5px solid transparent; border-radius: 13px; padding: 13px 15px; cursor: pointer; }
.jobpick button.on { border-color: var(--brand); background: var(--brand-subtle); }
.jobpick button .jp2 { display: block; font-size: 12px; color: var(--mut); margin-top: 1px; }

/* offline bar - pinned below the status bar, pushes the screen down when shown */
.offbar { position: absolute; top: 44px; left: 0; right: 0; z-index: 20; display: none; align-items: center; gap: 8px; padding: 8px 20px; background: var(--navy); color: #E8EDF3; font-size: 12px; font-weight: 500; line-height: 1.3; }
.offbar.on { display: flex; }
.offbar.on ~ .screens { top: 76px; }
.offbar.synced { background: var(--ok); color: #fff; }
.offbar svg { flex-shrink: 0; }

/* crew clock-in (lead) */
.crewbtn { display: flex; align-items: center; gap: 11px; width: calc(100% - 8px); margin: 0 4px 14px; padding: 13px 15px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(16,26,40,0.05); cursor: pointer; font-family: inherit; text-align: left; }
.crewbtn .cbi { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-subtle); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crewbtn .cbt { font-size: 14.5px; font-weight: 600; color: var(--ink-1); }
.crewbtn .cq { margin-left: auto; font-size: 12px; color: var(--mut); }
.crewbtn .cq.live { color: var(--ok); font-weight: 600; }
.crew { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.crew .cm { display: flex; align-items: center; gap: 11px; background: var(--bg); border-radius: 13px; padding: 11px 13px; }
.crew .cm .ca { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.crew .cm .cn { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.crew .cm .cr { font-size: 11.5px; color: var(--mut); }
.crew .cm .tog { margin-left: auto; width: 46px; height: 27px; border-radius: 999px; background: #cfd8e3; position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; border: none; }
.crew .cm .tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.crew .cm .tog.on { background: var(--ok); }
.crew .cm .tog.on::after { transform: translateX(19px); }
.crewnote { font-size: 12px; color: var(--mut); line-height: 1.45; margin: 2px 2px 6px; }

/* material add + receipt */
.mat.rcpt .mn { color: var(--brand); }
.urow { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.urow button { font-family: inherit; font-size: 13px; color: var(--ink-1); background: var(--bg); border: 1.5px solid transparent; border-radius: 999px; padding: 7px 13px; cursor: pointer; }
.urow button.on { border-color: var(--brand); background: var(--brand-subtle); color: var(--brand); }
.ef input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--ink); }
.ef input:focus { outline: none; border-color: var(--brand); }

.rowlist { margin: 0 4px; }
.rlrow { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.rlrow:last-child { border-bottom: none; }
.rlrow .ri { width: 32px; height: 32px; border-radius: 9px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--sky); flex-shrink: 0; }
.rlrow .rt { font-size: 14px; color: var(--ink-1); font-weight: 500; }
.rlrow .rs { font-size: 12px; color: var(--mut); }
.rlrow .ra { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-1); font-variant-numeric: tabular-nums; }

.sect { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); margin: 16px 6px 8px; }

/* log screen */
.logbox { margin: 0 4px 12px; }
.logbox textarea { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  font-family: inherit; font-size: 14px; color: var(--ink); resize: none; background: var(--card); line-height: 1.5; }
.logbox textarea:focus { outline: none; border-color: var(--brand); }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 4px 14px; }
.photos .ph { aspect-ratio: 1; border-radius: 12px; background: linear-gradient(135deg,#dbe3ee,#c7d3e2); }
.photos .add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--brand); background: var(--brand-subtle); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; }

/* tasks */
.task { display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin: 0 4px 9px; border-radius: 14px; background: var(--card); box-shadow: 0 2px 10px rgba(16,26,40,0.05); cursor: pointer; }
.task .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.task.done .box { background: var(--ok); border-color: var(--ok); }
.task .tt { font-size: 14.5px; color: var(--ink-1); font-weight: 500; }
.task.done .tt { color: var(--mut); text-decoration: line-through; }
.task .ts { font-size: 12px; color: var(--mut); margin-top: 1px; }

/* me screen */
.prof { text-align: center; padding: 16px 0 6px; }
.prof .pav { width: 74px; height: 74px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.prof .pn { font-size: 19px; font-weight: 700; color: var(--ink-1); }
.prof .pr { font-size: 13px; color: var(--mut); }
.wk { display: flex; gap: 10px; margin: 14px 4px; }
.wk .wc { flex: 1; background: var(--card); border-radius: 14px; padding: 13px; text-align: center; box-shadow: 0 2px 10px rgba(16,26,40,0.05); }
.wk .wc .wv { font-size: 22px; font-weight: 700; color: var(--ink-1); }
.wk .wc .wl { font-size: 11.5px; color: var(--mut); margin-top: 2px; }
.setrow { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--ink-1); }
.setrow .chev { margin-left: auto; color: var(--mut); }

/* header bell */
.bell { position: absolute; top: 55px; right: 66px; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink-1); cursor: pointer; z-index: 5; }
.bell .badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* section header with an action link */
.sect-row { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 6px 8px; }
.sect-row .sect { margin: 0; }
.sect-row .act { font-size: 12.5px; font-weight: 600; color: var(--brand); cursor: pointer; }

/* materials (log screen) */
.mat { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.mat .mn { flex: 1; font-size: 14px; color: var(--ink-1); }
.mat .mq { font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.matadd { display: flex; gap: 8px; margin: 12px 4px 5px; }
.matadd button { flex: 1; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--brand); background: var(--brand-subtle);
  border: 1px solid rgba(204,12,31,0.18); border-radius: 12px; padding: 11px; cursor: pointer; }
.matnote { font-size: 11.5px; color: var(--mut); margin: 3px 4px 14px; line-height: 1.4; }

/* timesheet + notifications (in sheets) */
.ts-status { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-radius: 13px; margin: 8px 0 10px; font-size: 13px; font-weight: 500; }
.ts-status.sub { background: rgba(81,137,173,0.12); color: var(--sky); }
.ts-status.appr { background: var(--ok-soft); color: var(--ok); }
.ts-day { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.ts-day .d { font-size: 13px; color: var(--ink-1); font-weight: 600; width: 54px; }
.ts-day .j { flex: 1; font-size: 12px; color: var(--mut); }
.ts-day .h { font-size: 14px; font-weight: 600; color: var(--ink-1); font-variant-numeric: tabular-nums; width: 44px; text-align: right; }
.schip { font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.schip.appr { background: var(--ok-soft); color: var(--ok); }
.schip.subm { background: rgba(81,137,173,0.12); color: var(--sky); }
.schip.pend { background: var(--bg); color: var(--mut); }
.ts-total { display: flex; justify-content: space-between; padding: 14px 2px 6px; font-weight: 700; color: var(--ink-1); font-size: 15px; }
.noti { display: flex; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.noti .ni { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.noti .ni.ok { background: var(--ok-soft); color: var(--ok); }
.noti .ni.br { background: var(--brand-subtle); color: var(--brand); }
.noti .ni.sk { background: rgba(81,137,173,0.12); color: var(--sky); }
.noti .nt { font-size: 13.5px; color: var(--ink-1); font-weight: 500; line-height: 1.35; }
.noti .ns { font-size: 12px; color: var(--mut); margin-top: 1px; }

/* edit-time sheet */
.ts-day { cursor: pointer; }
.ts-day .chev { color: var(--mut); font-size: 16px; margin-left: 2px; }
.editnote { font-size: 12.5px; padding: 11px 14px; border-radius: 12px; margin: 8px 0 12px; line-height: 1.45; }
.editnote.warn { background: var(--warn-soft); color: var(--warn); }
.editnote.appr { background: var(--ok-soft); color: var(--ok); }
.editnote.pend { background: rgba(81,137,173,0.12); color: var(--sky); }
.ef { margin: 14px 0; }
.ef .efl { font-size: 12px; font-weight: 600; color: var(--mut); margin-bottom: 6px; }
.ef .efv { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--ink-1); font-weight: 500; }
.ef .efv .chev { color: var(--mut); }
.stepper { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 12px; padding: 8px 14px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: none; background: #fff; color: var(--brand); font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 3px rgba(16,26,40,0.1); line-height: 1; }
.stepper .sv { flex: 1; text-align: center; font-size: 21px; font-weight: 700; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.ef textarea { width: 100%; min-height: 66px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--ink); resize: none; }
.ef textarea:focus { outline: none; border-color: var(--brand); }
.schip.edit { background: var(--warn-soft); color: var(--warn); }

/* scenario toggle (desktop legend) */
.scenlab { font-size: 12px; font-weight: 600; color: var(--mut); margin-top: 16px; }
.scentoggle { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-top: 7px; }
.scentoggle button { font-family: inherit; font-size: 12px; font-weight: 600; color: var(--mut); background: none; border: none; border-radius: 999px; padding: 6px 15px; cursor: pointer; }
.scentoggle button.on { background: var(--brand); color: #fff; }

/* flagged note (clock screen) */
.flagnote { display: none; align-items: center; gap: 8px; margin: 0 4px 14px; padding: 11px 14px; border-radius: 13px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.flagnote.on { display: flex; }
.flagnote svg { flex-shrink: 0; }

/* bottom sheet (off-site reason, task detail) */
.sheet-back { position: absolute; inset: 0; background: rgba(11,18,32,0.42); opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 40; }
.sheet-back.show { opacity: 1; visibility: visible; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 24px 24px 0 0; transform: translateY(100%);
  transition: transform .26s cubic-bezier(.2,.85,.25,1); max-height: 84%; overflow-y: auto; padding-bottom: 16px; box-shadow: 0 -12px 40px rgba(11,18,32,0.2); }
.sheet-back.show .sheet { transform: translateY(0); }
.sheet::-webkit-scrollbar { display: none; }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 10px auto 4px; }
.sheet-body { padding: 8px 20px 6px; }
.sh-title { font-size: 20px; font-weight: 700; color: var(--ink-1); letter-spacing: -.01em; }
.sh-sub { font-size: 13px; color: var(--mut); margin-top: 2px; }
.sh-p { font-size: 14px; color: var(--ink); line-height: 1.55; margin: 13px 0; }
.reasons { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.reason { text-align: left; font-family: inherit; font-size: 14px; color: var(--ink-1); background: var(--bg); border: 1.5px solid transparent; border-radius: 13px; padding: 13px 15px; cursor: pointer; }
.reason.on { border-color: var(--brand); background: var(--brand-subtle); }
.sh-actions { display: flex; gap: 10px; margin-top: 10px; }
.sh-btn { flex: 1; border: none; border-radius: 14px; padding: 14px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.sh-btn.primary { background: var(--brand); color: #fff; }
.sh-btn.ghost { background: var(--bg); color: var(--ink-1); }
.sh-btn:disabled { opacity: .45; cursor: not-allowed; }

/* bottom nav */
.bottomnav { position: absolute; bottom: 0; left: 0; right: 0; height: 62px; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: 6px; z-index: 20; }
.bottomnav button { flex: 1; background: none; border: none; font-family: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mut); cursor: pointer; font-size: 10.5px; font-weight: 600; }
.bottomnav button svg { width: 23px; height: 23px; }
.bottomnav button.on { color: var(--brand); }
