/* =====================================================================
   V2.46 — Change Request Batch 27 (screen only: media="screen", so PDF / print output stays as before)
   Item 5   navigation highlight: the open sub-module strongly, its main module subtly, also in the icon rail
   Items 1–4, 6, 7: the multi-download settings panel, site checklists, toolbox talks, permits, snags, KRA / KPI
   ===================================================================== */

/* ---------- item 5: where am I ---------- */
:root { --b27-accent: var(--b26-sky-600, #0369a1); --b27-accent-2: var(--b26-green-600, #15803d); }
/* the main module (department) holding the open screen: tinted background + accent bar, open or folded */
.nav-sec.has-active > .nav-group { position: relative; color: var(--sidebar-text, #fff); font-weight: 700;
  background: color-mix(in srgb, var(--b27-accent) 16%, transparent); border-radius: 8px; box-shadow: inset 3px 0 0 var(--b27-accent); }
.nav-sec.has-active > .nav-group .gi { background: var(--b27-accent); color: #fff; border-radius: 6px; padding: 1px 6px; }
.nav-sec.collapsed.has-active > .nav-group { color: var(--sidebar-text, #fff); box-shadow: inset 3px 0 0 var(--b27-accent); }
.nav-sec.has-active > .nav-items { background: color-mix(in srgb, var(--b27-accent) 6%, transparent); border-radius: 0 0 10px 10px; box-shadow: inset 3px 0 0 color-mix(in srgb, var(--b27-accent) 45%, transparent); }
/* the open sub-module: strong — solid gradient, bold, white text, a bright bar and a ring */
.nav a.active, html[data-ui="3"] .nav a.active, html[data-ui="3"] .nav-sec .nav-items a.active {
  background: linear-gradient(135deg, var(--b26-sky-700, #075985), var(--b26-green-700, #15803d)) !important; color: #fff !important; font-weight: 700;
  box-shadow: inset 4px 0 0 #fde68a, 0 0 0 2px color-mix(in srgb, var(--b27-accent) 55%, transparent), 0 6px 16px -6px rgba(3, 105, 161, .65) !important; }
.nav a.active .sn, .nav a.active svg { color: #fff !important; opacity: 1; }
html[data-ui="3"] .nav a.active svg { background: rgba(255, 255, 255, .22) !important; }
html[data-ui="3"] .nav-sec.has-active > .nav-group { color: var(--text); }
html[data-ui="3"] .nav-sec.has-active > .nav-group:hover { color: var(--text); }
/* collapsed sidebar (icon rail): the open screen's icon is highlighted, the department number carries the tint */
html[data-ui="3"] .app.kx-rail .nav a.active { box-shadow: 0 0 0 2px #fde68a, 0 6px 14px -6px rgba(3, 105, 161, .7) !important; }
html[data-ui="3"] .app.kx-rail .nav a.active svg { background: #fff !important; color: var(--b27-accent) !important; }
html[data-ui="3"] .app.kx-rail .nav-sec.has-active > .nav-group { background: color-mix(in srgb, var(--b27-accent) 22%, transparent); box-shadow: inset 0 -3px 0 var(--b27-accent); }
html[data-ui="3"] .app.kx-rail .nav-sec.has-active > .nav-group .gi { background: var(--b27-accent); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .nav a.active { transition: box-shadow .15s ease, background .15s ease; } }
@media (forced-colors: active) { .nav a.active { outline: 3px solid Highlight; } .nav-sec.has-active > .nav-group { outline: 1px solid Highlight; } }

/* ---------- item 1: one settings panel for the selected reports ---------- */
.b27-rset { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; padding: 10px 12px; margin: 8px 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.b27-rset label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.b27-rset label.ck { flex-direction: row; align-items: center; gap: 6px; }
.b27-rset h4 { grid-column: 1 / -1; margin: 0; font-size: 13px; }

/* ---------- items 2, 3, 7: site forms (phone first, big touch targets) ---------- */
.b27-form .b27-sec { margin: 10px 0 4px; font-weight: 700; font-size: 13px; color: var(--text-2, var(--text)); border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.b27-loc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.b27-items { display: flex; flex-direction: column; gap: 8px; }
.b27-it { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.b27-it.nok { border-color: var(--danger, #b42318); box-shadow: inset 4px 0 0 var(--danger, #b42318); }
.b27-it.ok { box-shadow: inset 4px 0 0 var(--b27-accent-2); }
.b27-it .q { font-size: 14px; margin-bottom: 6px; }
.b27-it .q .ref { font-size: 11px; color: var(--text-3); }
.b27-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.b27-seg button { min-width: 64px; min-height: 40px; border-radius: 9px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface-2); font-weight: 650; font-size: 14px; cursor: pointer; color: var(--text); }
.b27-seg button[aria-pressed="true"][data-v="ok"] { background: var(--b27-accent-2); color: #fff; border-color: transparent; }
.b27-seg button[aria-pressed="true"][data-v="nok"] { background: var(--danger, #b42318); color: #fff; border-color: transparent; }
.b27-seg button[aria-pressed="true"][data-v="na"] { background: var(--text-3, #667); color: #fff; border-color: transparent; }
.b27-it .more { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 6px; align-items: center; }
.b27-it .more input[type="text"] { min-height: 38px; font-size: 15px; }
.b27-it .ph { font-size: 12px; }
.b27-sig { border: 1px dashed var(--border-strong, #889); border-radius: 8px; background: #fff; touch-action: none; width: 100%; max-width: 420px; height: 130px; display: block; }
.b27-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.b27-pcard { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); cursor: pointer; box-shadow: inset 5px 0 0 var(--b27-accent-2); }
.b27-pcard.exp { box-shadow: inset 5px 0 0 var(--danger, #b42318); }
.b27-pcard.soon { box-shadow: inset 5px 0 0 #d97706; }
.b27-pcard h4 { margin: 0 0 4px; font-size: 14px; }
.b27-heat { border-collapse: collapse; font-size: 12px; }
.b27-heat th, .b27-heat td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; }
.b27-heat td.z { color: var(--text-3); }
.b27-heat td.g { background: color-mix(in srgb, var(--b27-accent-2) 22%, transparent); }
.b27-heat td.a { background: color-mix(in srgb, #d97706 22%, transparent); }
.b27-heat td.r { background: color-mix(in srgb, var(--danger, #b42318) 18%, transparent); }
.b27-pend { border-left: 4px solid #d97706; }
@media (max-width: 600px) {
  .b27-seg button { min-width: 72px; min-height: 46px; }
  .b27-it .more { grid-template-columns: 1fr; }
}
/* the app hides the checkbox of a .chip (it shows .chip.on instead): on the site forms the tick stays visible and a ticked
   chip is tinted, so the crew, hazards and attendees chosen can be seen at a glance */
.b27-form .chip { cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.b27-form .chip input { display: inline-block; width: 18px; height: 18px; margin: 0; }
.b27-form .chip:has(input:checked) { background: color-mix(in srgb, var(--b27-accent-2) 18%, transparent); border-color: var(--b27-accent-2); }
