:root {
  --black: #0F171A;
  --black-2: #1B272B;
  --yellow: #F6C111;
  --yellow-hover: #FFD43B;
  --ink: #141C1F;
  --muted: #454E52;
  --bg: #F4F4F1;
  --white: #fff;
  --line: #DEDED8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 1.05rem;
}
a { color: var(--ink); }
.site-header {
  background: var(--black);
  color: var(--white);
  border-bottom: 4px solid var(--yellow);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { color: var(--white); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand small { display: block; color: var(--yellow); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; margin-top: 3px; }
nav { display: flex; flex-wrap: wrap; gap: 6px; }
nav a, .btn-text {
  color: var(--yellow);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 4px;
}
nav a.active, nav a:hover, .btn-text:hover { background: var(--black-2); color: var(--white); }
.wrap { max-width: 980px; margin: 0 auto; padding: 22px 16px 48px; }
h1 { font-size: 1.7rem; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 22px; }
.cards { display: grid; gap: 14px; }
@media (min-width: 720px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--white);
  border-radius: 6px;
  padding: 20px;
  border-left: 8px solid var(--yellow);
  box-shadow: 0 1px 0 rgba(15,23,26,.06);
  text-decoration: none;
  color: inherit;
  display: block;
}
.card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
label { font-weight: 700; display: block; margin: 0 0 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}
textarea { min-height: 120px; }
.field { margin: 0 0 14px; }
.btn {
  display: inline-block;
  background: var(--yellow);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 4px;
  border: 2px solid var(--yellow);
  cursor: pointer;
  font: inherit;
}
.btn:hover { background: var(--yellow-hover); }
.btn.secondary { background: transparent; border-color: var(--black); }
.auth {
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--black-2);
  border-top: 4px solid var(--yellow);
  padding: 28px 24px 24px;
  border-radius: 6px;
}
.auth h1 { color: var(--white); }
.auth .lede { color: #D5D9DB; }
.auth label { color: var(--yellow); }
.msg { margin: 12px 0 0; color: #ffb4b4; }
.ok { color: #b7e3b0; }
.list { display: grid; gap: 12px; }
.item {
  background: var(--white);
  border-radius: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  position: relative;
}
[hidden] { display: none !important; }
.item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.item .meta { color: var(--muted); font-size: .92rem; margin: 0 0 8px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .field { margin: 0; min-width: 180px; }

.log-photos{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.log-photos img{width:110px;height:110px;object-fit:cover;border:2px solid var(--yellow, #f5c400);border-radius:6px;display:block;background:#222}
.log-actions{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:8px;
  margin:0 0 14px;
  min-height:40px;
  overflow-x:auto;
}
.log-actions .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:120px;
  min-width:120px;
  height:40px;
  min-height:40px;
  padding:0 8px;
  margin:0;
  font-size:14px;
  line-height:1;
  white-space:nowrap;
  flex:0 0 120px;
}
.log-actions .btn-delete{margin-left:auto}
.log-actions-msg{margin:0 0 8px}
.log-notes{white-space:pre-wrap}

.item h4{font-size:1rem;margin:16px 0 4px}
.log-fields{margin:6px 0 12px}.log-fields dt{font-weight:700}.log-fields dd{margin:0 0 8px;white-space:pre-wrap}
.log-notes,.log-fields dd{overflow-wrap:anywhere}
.log-error{color:#9b2226;background:#fff;padding:16px;border:1px solid #9b2226;border-radius:4px}

.checklist{display:flex;flex-direction:column;gap:8px}
.checklist .check{font-weight:600}
[data-safety-topics]:not(.is-open){display:none}

.file-drop{border-radius:6px}
.file-drop.is-drop-target{
  box-shadow:inset 0 0 0 2px var(--yellow, #f5c400);
  background:rgba(245, 196, 0, 0.1);
}

.checklist-scroll{max-height:220px;overflow:auto;padding:10px;border:1px solid var(--line);border-radius:6px}
.todo-file-list{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.todo-file-list a{font-weight:700}
#todoFilePreview img{max-width:120px;max-height:120px;margin:6px 6px 0 0;border-radius:4px}
.multi-select{position:relative}
.multi-select-toggle{
  position:relative;
  width:100%;
  font:inherit;
  padding:12px 36px 12px 12px;
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--white);
  text-align:left;
  cursor:pointer;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.multi-select-toggle::after{
  content:"";
  position:absolute;
  right:14px;
  top:50%;
  margin-top:-3px;
  border:5px solid transparent;
  border-top-color:var(--muted);
}
.multi-select-toggle[aria-expanded="true"]{border-color:var(--black)}
.multi-select-panel{
  position:absolute;
  z-index:8;
  left:0;
  right:0;
  top:calc(100% + 4px);
  max-height:220px;
  overflow:auto;
  padding:10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--white);
  box-shadow:0 8px 20px rgba(15,23,26,.12);
}

.upload-panel{
  border:2px dashed var(--line);
  border-radius:6px;
  padding:16px;
  text-align:center;
  background:var(--white);
}
.file-drop.is-drop-target .upload-panel{
  border-color:var(--yellow, #f5c400);
  background:rgba(245, 196, 0, 0.1);
}
.upload-panel .btn{margin:0}
.upload-ways{
  margin:10px 0 0;
  font-weight:800;
}

.upload-panel input[type="file"]{display:none !important}


.emp-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.emp-actions .btn{width:auto;min-width:0}
.btn.danger{background:transparent;border-color:#8B1E1E;color:#8B1E1E}
.badge{display:inline-block;font-size:.8rem;font-weight:700;padding:2px 8px;border-radius:99px;background:#e8e8e2;margin-left:8px;vertical-align:middle}
.badge.inactive{background:#f3d4d4}
.item.is-inactive{opacity:.82}

/* SMS text-alert opt-in */
.sms-card{width:min(520px,100%)}
.sms-card h1{font-size:1.45rem;line-height:1.25}
.sms-phone{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:4px 12px;background:#111;border:1px solid #333;border-left:6px solid var(--yellow);padding:12px 14px;margin:0 0 16px;color:#D5D9DB}
.sms-phone strong{color:#fff;font-size:1.15rem;letter-spacing:.02em;white-space:nowrap}
.sms-phone span{white-space:nowrap}
.sms-disclosure{font-size:.86rem;line-height:1.5;color:#C9CED1;margin:0 0 18px}
.sms-disclosure a{color:var(--yellow)}
.sms-actions{display:flex;flex-direction:column;gap:10px;margin:0 0 14px}
.sms-actions .btn{width:100%;margin:0}
.sms-actions .btn[disabled]{opacity:.45;cursor:not-allowed}
.auth .btn.secondary.sms-no{color:#fff;border-color:#D5D9DB;background:transparent}
.sms-small{font-size:.82rem}
.sms-warn{background:#3a2a00;border:1px solid var(--yellow);color:#ffe9a8;padding:10px 12px;font-size:.9rem}
.sms-status{background:#102a12;border:1px solid #3c7a40;color:#bfe6bf;padding:10px 12px;font-size:.9rem}
.demo-banner{margin:0 0 16px;background:#fff6d6;color:#222;border:2px dashed #b38a00;padding:10px 14px;font-size:.88rem;line-height:1.4}

.temp-pw{margin-top:12px;padding:12px 14px;border:2px dashed var(--yellow,#F6C111);border-radius:6px;background:rgba(246,193,17,.08)}
.temp-pw-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:6px 0}
.temp-pw-value{font-size:1.25rem;letter-spacing:.06em;padding:6px 10px;background:#111;color:#fff;border-radius:4px;user-select:all}
.badge.pending{background:#F6C111;color:#111}
.rc-totals{width:100%;border-collapse:collapse;margin-top:6px}
.rc-totals th,.rc-totals td{text-align:left;padding:6px 8px;border-bottom:1px solid #e3e3dc}
.rc-totals td:nth-child(n+2),.rc-totals th:nth-child(n+2){text-align:right}
label.check{display:flex;gap:8px;align-items:center;font-weight:600}
label.check input{width:auto;min-height:0}
.rc-totals tfoot th{border-top:2px solid #141C1F}
.rc-cat-row{align-items:center}
.rc-cat-row .field{min-width:200px}


/* Compact daily-log list rows */
.log-list{display:flex;flex-direction:column;gap:8px}
.log-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px 16px;
  background:var(--white);
  border:1px solid var(--line);
  border-left:6px solid var(--yellow);
  border-radius:6px;
  padding:14px 16px;
  text-decoration:none;
  color:inherit;
  min-height:56px;
}
.log-row:hover,.log-row:focus-visible{
  background:#fffdf4;
  border-color:var(--yellow);
  outline:none;
}
.log-row-main{
  display:flex;
  flex-wrap:wrap;
  gap:4px 14px;
  align-items:baseline;
  flex:1 1 220px;
  min-width:0;
}
.log-row-date{font-weight:800}
.log-row-job{font-weight:700}
.log-row-who,.log-row-title{color:var(--muted);font-size:.95rem}
.log-row-pills{display:flex;flex-wrap:wrap;gap:6px}
.log-pill{
  font-size:.78rem;
  font-weight:700;
  background:#e8e8e2;
  border-radius:99px;
  padding:2px 8px;
  white-space:nowrap;
}
.log-pill-safety{background:#e7f3e6}
.log-row-go{font-weight:800;color:var(--muted);margin-left:auto}
.back-link{
  display:inline-block;
  font-weight:700;
  margin:0 0 16px;
  color:var(--ink);
}
@media (max-width:600px){
  .log-row{align-items:flex-start;flex-direction:column;gap:8px;padding:14px}
  .log-row-main{flex-direction:column;gap:2px;flex-basis:auto}
  .log-row-go{margin-left:0}
  .filters{align-items:stretch}
  .filters .field{min-width:0;flex:1 1 100%}
  .filters .btn{width:100%}
  .log-actions{flex-wrap:wrap;overflow:visible}
  .log-actions .btn,.log-actions .btn-delete{flex:1 1 calc(50% - 8px);width:auto;min-width:0;margin-left:0}
}

.pending-files{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
.pending-file{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;max-width:220px}
.pending-file.is-image img{width:110px;height:110px;object-fit:cover;border:2px solid var(--yellow, #f5c400);border-radius:6px;display:block;background:#222}
.pending-file-remove{
  font:inherit;font-size:.85rem;font-weight:700;
  padding:4px 8px;border:1px solid var(--line);border-radius:4px;
  background:transparent;cursor:pointer;color:#111;
}
.pending-file-remove:hover{border-color:#8B1E1E;color:#8B1E1E}
.log-files{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.log-file{
  display:flex;align-items:center;gap:10px;
  padding:8px 10px;border:1px solid var(--line);border-radius:6px;
  background:var(--white);text-decoration:none;color:inherit;font-weight:700;
  max-width:100%;
}
.log-file-name{overflow-wrap:anywhere}
.log-file-icon{
  flex:0 0 36px;height:40px;border-radius:4px;border:1px solid #bbb;
  background:#f3f3ee;display:flex;align-items:center;justify-content:center;
  font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.02em;
}
.log-file[data-ext="pdf"]{border-left:4px solid #b42318}
.log-file[data-ext="doc"],.log-file[data-ext="docx"]{border-left:4px solid #2b579a}
.log-file[data-ext="xls"],.log-file[data-ext="xlsx"],.log-file[data-ext="csv"]{border-left:4px solid #217346}
.log-file[data-ext="ppt"],.log-file[data-ext="pptx"]{border-left:4px solid #c43e1c}
.log-file[data-ext="txt"]{border-left:4px solid #555}
.upload-panel{
  min-height:92px;
}
form.file-drop.is-drop-target,
.field.file-drop.is-drop-target,
.item.file-drop.is-drop-target{
  outline:2px solid var(--yellow, #f5c400);
  outline-offset:4px;
}
.file-note{margin:8px 0 0}
#photoFileMsg{margin-top:8px}
