.sidebar { overflow-y: auto; padding: 22px 16px 14px; gap: 10px; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }
.nav-sign-in-btn { margin: 0 8px 10px; width: calc(100% - 16px); justify-content: flex-start; background: rgba(98,214,174,.12); border: 1px solid rgba(98,214,174,.3); color: #62d6ae; font-weight: 700; }
.nav-sign-in-btn:hover { background: rgba(98,214,174,.22); border-color: rgba(98,214,174,.5); color: #fff; }
.nav-sign-in-btn[hidden] { display: none; }
.nav-item[hidden] { display: none; }
.portal-brand { margin-bottom: 14px; font-size: 14px; line-height: 1.22; }
.project-chip { margin: 0 8px 10px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; color: #e7b95e; font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.sidebar-user-card { display:flex; flex-direction:column; gap:8px; margin:0 8px 18px; padding:12px; border-radius:11px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); }
.sidebar-user-card[hidden] { display:none; }
.sidebar-user-copy { min-width:0; }
.sidebar-user-copy span,.sidebar-user-copy strong,.sidebar-user-copy small,.sidebar-user-copy time { display:block; }
.sidebar-user-copy span { color:#9fb7c6; font-size:9px; text-transform:uppercase; letter-spacing:.07em; }
.sidebar-user-copy strong { margin-top:2px; overflow:hidden; color:#fff; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-user-copy small { margin-top:2px; overflow:hidden; color:#b8cbd5; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-user-copy time { margin-top:6px; color:#7fa1b3; font-size:8px; line-height:1.35; }
.sidebar-sign-out { display:flex; align-items:center; gap:7px; width:100%; padding:7px 10px; border:1px solid rgba(255,255,255,.14); border-radius:8px; background:transparent; color:#9fb7c6; font:600 10px "DM Sans"; cursor:pointer; }
.sidebar-sign-out:hover { background:rgba(255,255,255,.1); color:#fff; }
.sidebar nav { gap: 5px; }
#nav-main-section { display: grid; gap: 10px; }
#nav-main-section[hidden] { display: none; }
#nav-tools-section { display: grid; gap: 5px; margin-top: 4px; }
#nav-tools-section[hidden] { display: none; }
.sidebar .nav-item { min-height: 30px; padding: 6px 9px; border-radius: 6px; font-size: 13px; line-height: 1.25; }
.sidebar .nav-item span { width: 17px; flex: 0 0 17px; text-align: center; font-size: 14px; }
.sidebar .nav-item b { min-width: 20px; padding: 1px 6px; font-size: 10px; }
.sidebar .nav-item.active { background: rgba(255,255,255,.11); }
.module-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 10px; margin-bottom: 22px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.module-tabs::-webkit-scrollbar { display: none; }
.module-tab { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; padding: 13px 16px; min-width: 190px; max-width: 240px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); text-align: left; cursor: pointer; }
.module-tab > span { font-size: 20px; }
.module-tab strong,.module-tab small { display: block; }
.module-tab strong { color: var(--ink); font-size: 14px; }
.module-tab small { margin-top: 2px; font-size: 10px; }
.module-tab.active { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px rgba(46,113,134,.08); }
.source-note { color: var(--muted); font-size: 11px; }
.wir-tools { flex-wrap: wrap; }
.wir-table { min-width: 1260px; }
.wir-table td { vertical-align: top; }
.stat-card-button { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.stat-card-button:hover,.stat-card-button.active { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(46,113,134,.1); transform: translateY(-1px); }
.revision-panel { margin-bottom: 20px; }
.revision-pipeline { display: grid; grid-template-columns: repeat(4,1fr); padding: 20px 22px 24px; }
.revision-stage { position: relative; border: 0; background: transparent; padding: 0 16px; text-align: center; cursor: pointer; }
.revision-stage:not(:last-child)::after { content: "→"; position: absolute; top: 16px; right: -8px; color: var(--muted); font-size: 20px; }
.revision-letter { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 9px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); font: 800 19px "Libre Franklin"; }
.revision-stage:hover .revision-letter,.revision-stage.active .revision-letter { background: var(--navy); color: #fff; }
.revision-stage strong,.revision-stage small { display: block; }
.revision-stage strong { font-size: 12px; }
.revision-stage small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.revision-count { display: inline-block; margin-top: 7px; padding: 3px 8px; border-radius: 999px; background: #edf2f3; color: var(--ink); font-size: 10px; font-weight: 800; }
.wir-alarm-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.alarm-summary-card { border-radius: 13px; padding: 17px; background: #fff; border: 1px solid var(--line); cursor: pointer; text-align: left; }
.alarm-summary-card strong,.alarm-summary-card small { display: block; }
.alarm-summary-card strong { margin: 8px 0 3px; font-size: 25px; }
.alarm-summary-card small { color: var(--muted); }
.wir-alert-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
.wir-attention-list { padding: 6px 22px 14px; max-height: 410px; overflow: auto; }
.wir-attention-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wir-attention-item:last-child { border-bottom: 0; }
.wir-attention-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.wir-alarm-desc { margin-top: 5px !important; color: var(--ink) !important; font-size: 11px; line-height: 1.45; border-left: 2px solid var(--line); padding-left: 7px; }
.wir-status { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-nor { background: #f8d7d3; color: #a92f22; }
.status-nonoc-b { background: #fff0c8; color: #8b6217; }
.status-nonoc-c { background: #dff1e9; color: #217058; }
.status-review,.status-submitted { background: #dcebf8; color: #245e91; }
.status-nono { background: #e3f3ed; color: #25745b; }
.wir-legend { padding: 8px 22px 16px; }
.wir-legend > div { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wir-legend > div:last-child { border-bottom: 0; }
.wir-legend p,.wir-legend strong,.wir-legend small { display: block; margin: 0; }
.wir-legend strong { font-size: 12px; }
.wir-legend small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.wir-description strong,.wir-description small { display: block; }
.wir-description small { max-width: 440px; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.wir-ref { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 11px; }
.revision-badge { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.row-action { display:inline-flex; align-items:center; gap:5px; padding:7px 14px; border:0; border-radius:8px; background:var(--teal); color:#fff; font:700 12px "DM Sans"; cursor:pointer; white-space:nowrap; transition:.12s; }
.row-action:hover { background:var(--navy); }
.row-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.row-action.danger { background:#fde8e8; color:#c0392b; }
.row-action.danger:hover { background:#f7d0d0; color:#96281f; }
.item-auto-tag { font-size:10px; font-weight:700; color:var(--teal); text-transform:uppercase; letter-spacing:.05em; }
#wir-dialog { max-height: calc(100vh - 24px); overflow: auto; }
.contact-hero { display: flex; align-items: center; gap: 22px; padding: 28px; }
.contact-hero p:last-child { margin: 7px 0 0; color: var(--muted); }
.contact-logo { width: 76px; height: 76px; object-fit: contain; border-radius: 50%; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.contact-card { padding: 26px; }
.contact-card p,.contact-card address { color: var(--muted); font-style: normal; line-height: 1.65; }
.contact-people-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:20px; }
.contact-right-col { display:flex; flex-direction:column; gap:20px; }
.contact-people-card { padding:22px 24px 18px; }
.contact-people-card .eyebrow { margin:0 0 4px; }
.contact-person-list { display:grid; }
.contact-row { display:flex; justify-content:space-between; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.contact-row:last-child { border-bottom:0; }
.contact-row strong { font-size:13px; color:var(--ink); }
.contact-num-wrap { display:flex; align-items:center; gap:6px; }
.contact-num { color:var(--teal); font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; text-decoration:none; letter-spacing:.02em; }
.contact-num:hover { text-decoration:underline; }
.copy-btn { border:0; background:transparent; color:var(--muted); font-size:15px; cursor:pointer; padding:3px 5px; border-radius:6px; line-height:1; transition:.12s; }
.copy-btn:hover { background:var(--teal-soft); color:var(--teal); }
.copy-btn.copied { color:var(--green); }
@media(max-width:760px){.contact-people-grid{grid-template-columns:1fr}}
.portalet-hero { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:10px 14px; margin-bottom:12px; background:linear-gradient(135deg,#fff 62%,var(--teal-soft)); }
.portalet-hero h2 { margin:1px 0 2px; }
.portalet-hero p:last-child { max-width:70ch; margin:0; color:var(--muted); font-size:11.5px; line-height:1.45; }
.portalet-asof { min-width:150px; padding:7px 11px; border:1px solid rgba(46,113,134,.2); border-radius:7px; background:#fff; }
.portalet-asof span,.portalet-asof strong { display:block; }
.portalet-asof span { color:var(--teal); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.portalet-asof strong { margin-top:2px; font-size:11px; }
.portalet-dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:12px 0; }
.portalet-breakdown,.movement-feed { padding:4px 14px 10px; }
.movement-item { display:grid; grid-template-columns:32px 1fr; gap:10px; width:100%; padding:12px 0; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; cursor:pointer; }
.movement-item:last-child { border-bottom:0; }
.movement-item:hover strong { color:var(--teal); }
.movement-arrow { display:grid; place-items:center; width:30px; height:30px; border-radius:9px; background:var(--teal-soft); color:var(--teal); font-weight:800; }
.movement-item strong,.movement-item small,.movement-item time { display:block; }
.movement-item small { margin-top:3px; color:var(--muted); font-size:10px; line-height:1.35; }
.movement-item time { margin-top:4px; color:#8494a3; font-size:9px; }
.portalet-tools { flex-wrap:wrap; }
.portalet-table { min-width:1500px; }
.portalet-table td { vertical-align:top; }
.sort-header { appearance:none; width:100%; display:inline-flex; align-items:center; gap:6px; justify-content:flex-start; border:0; background:transparent; color:inherit; font:inherit; text-transform:inherit; letter-spacing:inherit; padding:0; cursor:pointer; }
.sort-header:hover,.sort-header.active { color:var(--teal); }
.sort-arrow { display:inline-grid; place-items:center; min-width:15px; height:15px; border-radius:5px; background:#edf3f4; color:#78909b; font-size:9px; line-height:1; }
.sort-header.active .sort-arrow { background:var(--teal-soft); color:var(--teal); }
.portalet-table td small { display:block; max-width:290px; margin-top:4px; color:var(--muted); line-height:1.4; }
.portalet-tags { display:flex; flex-wrap:wrap; gap:4px; max-width:190px; }
.portalet-tags i { padding:3px 6px; border-radius:999px; background:#edf3f4; color:#4d6674; font-size:9px; font-style:normal; font-weight:700; }
.quantity-badge { display:inline-grid; place-items:center; min-width:34px; height:34px; border-radius:10px; background:var(--navy); color:#fff; font-size:16px; }
.portalet-dialog { width:min(820px,calc(100vw - 24px)); max-height:calc(100vh - 24px); overflow:auto; }
.movement-history { margin:18px 20px 0; padding:15px 17px; border:1px solid var(--line); border-radius:11px; background:#f7fafb; }
.movement-history > div { padding:9px 0; border-bottom:1px solid var(--line); }
.movement-history > div:last-child { border-bottom:0; }
.movement-history strong,.movement-history small { display:block; }
.movement-history strong { font-size:11px; }
.movement-history small { margin-top:3px; color:var(--muted); font-size:9px; }
.movement-note { margin:14px 20px 0; color:var(--teal); font-size:10px; font-weight:700; }
@media(max-width:1000px){.wir-alert-grid{grid-template-columns:1fr}.wir-alarm-summary{grid-template-columns:1fr 1fr}}
@media(max-width:1000px){.portalet-dashboard-grid{grid-template-columns:1fr}}
@media(max-width:760px){.module-tab{padding:10px}.module-tab small{display:block}.contact-grid{grid-template-columns:1fr}.contact-hero{align-items:flex-start}.contact-logo{width:48px;height:48px}.wir-attention-item{grid-template-columns:1fr}.wir-attention-item .text-button{text-align:left;padding:0}.revision-pipeline{grid-template-columns:1fr 1fr;gap:20px}.revision-stage:nth-child(2)::after{display:none}.portalet-hero{align-items:flex-start;flex-direction:column}.portalet-asof{width:100%}}

/* ── Payment Tracking to Subcon ── */
.subcon-hero { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:24px 26px; margin-bottom:20px; background:linear-gradient(135deg,#fff 55%,#f5f0ff); }
.subcon-hero h2 { margin:3px 0 7px; }
.subcon-hero p:last-child { max-width:760px; margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.subcon-dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin:20px 0; }
.subcon-recent-list { padding:8px 22px 18px; }
.subcon-recent-list .movement-item { grid-template-columns:32px 1fr auto; }
.subcon-recent-list .movement-arrow { background:#f5f0ff; color:#6b3fa0; }
.subcon-table { min-width:1200px; }
.subcon-table td { vertical-align:top; }
.subcon-table td strong { display:block; }
.subcon-table td small { display:block; margin-top:3px; color:var(--muted); font-size:11px; max-width:320px; line-height:1.35; }
.subcon-amount { font-size:14px; font-weight:800; font-variant-numeric:tabular-nums; color:var(--ink); }
.subcon-owed { color:var(--red); font-weight:700; font-size:12px; }
.subcon-clear { color:var(--green); font-weight:700; font-size:12px; }
.subcon-header-actions { display:flex; align-items:center; gap:10px; }
.subcon-dialog { width:min(780px,calc(100vw - 24px)); max-height:calc(100vh - 24px); overflow:auto; }
.subcon-form-grid { padding-bottom:6px; }
.subcon-extra-section { padding:0 0 16px; border-top:1px solid var(--line); margin-top:4px; }
.subcon-extra-section .eyebrow { padding-top:14px; }
@media(max-width:1000px){.subcon-dashboard-grid{grid-template-columns:1fr}}
@media(max-width:760px){.subcon-hero{align-items:flex-start;flex-direction:column}.portalet-asof{width:100%}}

/* ── Excel-style column header filters ── */
.excel-th-wrap { display:flex; align-items:center; gap:4px; white-space:nowrap; }
.excel-filter-btn { flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.3); border-radius:5px; cursor:pointer; font-size:13px; font-weight:700; padding:3px 7px; color:inherit; line-height:1; transition:background 0.15s,border-color 0.15s,transform 0.1s; }
.excel-filter-btn:hover { background:rgba(255,255,255,0.28); border-color:rgba(255,255,255,0.55); transform:scale(1.08); }
.excel-filter-btn.has-filter { background:var(--teal); color:#fff; border-color:var(--teal); box-shadow:0 0 0 2px rgba(46,113,134,0.25); }
#excel-filter-panel { position:absolute; z-index:9999; background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,0.15); min-width:220px; padding:6px 0; }
.excel-dd-item { display:block; width:100%; text-align:left; background:none; border:none; cursor:pointer; padding:9px 16px; font-size:13px; color:var(--ink); white-space:nowrap; transition:background 0.1s; }
.excel-dd-item:hover { background:var(--teal-soft); }
.excel-dd-item.active { font-weight:700; color:var(--teal); }

/* ── File attachments ── */
.form-attachments { padding:0 24px 18px; border-top:1px solid var(--line); margin-top:4px; }
.attachments-header { display:flex; justify-content:space-between; align-items:center; padding:14px 0 10px; }
.attach-file-btn { cursor:pointer; font-size:12px; padding:8px 13px; }
.attach-file-btn input { display:none; }
.attachment-list { display:grid; gap:7px; }
.attachment-item { display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:#f8fafb; }
.attachment-icon { font-size:19px; flex-shrink:0; line-height:1; }
.attachment-info { flex:1; min-width:0; }
.attachment-name { display:block; color:var(--teal); font-weight:700; font-size:13px; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.attachment-name:hover { text-decoration:underline; }
.attachment-info small { color:var(--muted); font-size:10px; display:block; margin-top:2px; }
.attachment-delete { border:0; background:transparent; color:var(--muted); font-size:20px; line-height:1; cursor:pointer; padding:2px 6px; border-radius:6px; }
.attachment-delete:hover { background:var(--red-soft); color:var(--red); }
.attachment-empty { padding:18px; text-align:center; color:var(--muted); font-size:12px; border:2px dashed var(--line); border-radius:10px; line-height:1.5; }

/* ── Permit documents dialog ───────────────────────────────────────────── */
.attachment-summary { margin:0; padding:0 16px 4px; color:var(--muted); font-size:12px; }
.attachment-actions { display:flex; align-items:center; gap:2px; flex-shrink:0; }
.attachment-actions .text-button { font-size:11px; padding:3px 6px; border-radius:5px; }
.attachment-actions .text-button:hover:not(:disabled) { background:var(--teal-soft); }
.attachment-actions .text-button.danger { color:var(--red); }
.attachment-actions .text-button.danger:hover:not(:disabled) { background:var(--red-soft); }
.attachment-actions .text-button:disabled { opacity:.45; cursor:default; }
/* A superseded document stays legible — it is still evidence — but reads as
   past tense rather than competing with the document that replaced it. */
.attachment-item.is-superseded { background:#fbfbfa; border-style:dashed; }
.attachment-item.is-superseded .attachment-name { color:var(--muted); text-decoration:line-through; }
.doc-retired { color:#a87920 !important; font-weight:700; margin-top:2px; }
.files-upload-bar { display:flex; align-items:flex-end; gap:10px; padding:14px 16px 6px; flex-wrap:wrap; }
.files-type-label { display:grid; gap:4px; font-size:11px; font-weight:700; color:#465d6b; flex:1; min-width:190px; }
.files-type-label select { width:100%; border:1px solid #cedadd; border-radius:6px; padding:6px 9px; font:inherit; font-size:13px; color:var(--ink); outline:0; background:#fff; }
.files-hint { margin:0; padding:0 16px 8px; color:var(--muted); font-size:11px; }
.files-section-label { padding:10px 16px 6px; font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--teal); }
#files-current-list, #files-history-list { padding:0 16px; }
#upload-progress-area:not(:empty) { padding:4px 16px; }
.replace-notice { margin:0 16px 8px; padding:8px 11px; border-radius:8px; background:var(--amber-soft); border:1px solid #e9d5a5; color:#7a5a15; font-size:12px; line-height:1.45; display:flex; align-items:flex-start; gap:10px; }
.replace-notice > span { flex:1; }
.cancel-replace { flex-shrink:0; border:1px solid #d9c084; background:#fff; color:#7a5a15; font-family:inherit; font-size:11px; font-weight:700; border-radius:6px; padding:3px 8px; cursor:pointer; white-space:nowrap; }
.cancel-replace:hover { background:#7a5a15; border-color:#7a5a15; color:#fff; }
#files-history { margin:8px 16px 0; border-top:1px solid var(--line); padding-top:10px; }
#files-history summary { cursor:pointer; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.07em; }
#files-history .files-hint { padding:6px 0 8px; }
#files-history-list { padding:0; }
.history-count { background:var(--amber-soft); color:#8d6419; border-radius:999px; padding:1px 7px; margin-left:4px; letter-spacing:0; }
/* Nothing in the dialog is clickable while bytes are moving: the guard that
   stops a double-clicked button attaching the same certificate twice. */
#files-dialog.is-busy .attachment-actions, #files-dialog.is-busy .attach-file-btn { pointer-events:none; opacity:.5; }
.file-manage { border:1px dashed var(--line); background:transparent; color:var(--teal); font-size:11px; font-weight:700; border-radius:999px; padding:3px 9px; margin:2px 0 2px 2px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.file-manage:hover { background:var(--teal-soft); border-style:solid; }
.file-history-tag { display:inline-flex; align-items:center; font-size:10px; font-weight:700; color:#8d6419; background:var(--amber-soft); border-radius:999px; padding:2px 7px; margin:2px 2px 2px 0; white-space:nowrap; }
.upload-row { display:flex; align-items:center; gap:10px; padding:8px 0; font-size:12px; color:var(--muted); }
.upload-row span { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.upload-bar { flex:2; height:5px; border-radius:99px; background:var(--teal-soft); overflow:hidden; }
.upload-bar-fill { height:100%; background:var(--teal); border-radius:99px; transition:width .15s; }

/* ── Search trigger (topbar) ── */
.search-trigger { display:flex; align-items:center; gap:9px; padding:9px 14px; border:1px solid var(--line); border-radius:10px; background:#f5f8f9; color:var(--muted); font:600 13px "DM Sans"; cursor:pointer; transition:.15s; min-width:190px; }
.search-trigger:hover { border-color:var(--teal); color:var(--teal); background:var(--teal-soft); }
.search-trigger-icon { font-size:17px; }
.search-trigger-label { flex:1; text-align:left; }
.search-trigger kbd { padding:2px 7px; border-radius:5px; background:rgba(0,0,0,.06); color:var(--muted); font:700 10px "DM Sans"; border:1px solid var(--line); }

/* ── Spotlight overlay ── */
.spotlight { position:fixed; inset:0; z-index:100; display:grid; align-items:start; justify-items:center; padding-top:14vh; background:rgba(8,18,30,.7); backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px); }
.spotlight[hidden] { display:none; }
.spotlight-box { width:min(640px,calc(100vw - 24px)); border-radius:18px; background:rgba(16,36,56,.97); border:1px solid rgba(255,255,255,.14); box-shadow:0 48px 140px rgba(0,0,0,.75),0 0 0 1px rgba(255,255,255,.04); overflow:hidden; animation:sl-in .16s cubic-bezier(.22,.8,.4,1); }
@keyframes sl-in { from { opacity:0; transform:scale(.95) translateY(-12px); } to { opacity:1; transform:none; } }
.spotlight-search-row { display:flex; align-items:center; gap:12px; padding:16px 20px 15px; border-bottom:1px solid rgba(255,255,255,.09); }
.spotlight-search-icon { font-size:22px; color:rgba(255,255,255,.35); flex-shrink:0; line-height:1; }
.spotlight-input { flex:1; background:transparent; border:0; outline:0; color:#fff; font:500 19px "DM Sans"; }
.spotlight-input::placeholder { color:rgba(255,255,255,.28); }
.spotlight-esc-badge { display:inline-flex; align-items:center; padding:3px 8px; border-radius:6px; background:rgba(255,255,255,.09); color:rgba(255,255,255,.4); font:700 11px "DM Sans"; border:1px solid rgba(255,255,255,.12); cursor:default; flex-shrink:0; }
.spotlight-results { max-height:400px; overflow-y:auto; padding:6px 0; }
.spotlight-results:empty::after { content:"Type to search across permits, WIR and portalets."; display:block; padding:30px 22px; text-align:center; color:rgba(255,255,255,.28); font-size:13px; line-height:1.6; }
.spotlight-group-label { padding:12px 20px 5px; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.11em; color:rgba(255,255,255,.32); }
.spotlight-item { display:flex; align-items:center; gap:12px; padding:10px 18px; cursor:pointer; border-radius:0; transition:background .1s; }
.spotlight-item:hover,.spotlight-item.sl-active { background:rgba(46,113,134,.38); }
.spotlight-item-icon { width:34px; height:34px; border-radius:10px; background:rgba(255,255,255,.1); display:grid; place-items:center; font-size:15px; color:rgba(255,255,255,.65); flex-shrink:0; transition:.1s; }
.spotlight-item.sl-active .spotlight-item-icon { background:var(--teal); color:#fff; }
.spotlight-item-body { flex:1; min-width:0; }
.spotlight-item-title { color:#fff; font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spotlight-item-sub { color:rgba(255,255,255,.42); font-size:11px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spotlight-item-tag { padding:3px 9px; border-radius:999px; font-size:10px; font-weight:700; background:rgba(255,255,255,.1); color:rgba(255,255,255,.55); white-space:nowrap; flex-shrink:0; }
.spotlight-no-results { padding:38px 22px; text-align:center; color:rgba(255,255,255,.35); font-size:13px; }
.spotlight-no-results strong { color:rgba(255,255,255,.6); }
.spotlight-footer { display:flex; gap:18px; padding:10px 20px; border-top:1px solid rgba(255,255,255,.07); }
.spotlight-footer span { display:flex; align-items:center; gap:5px; color:rgba(255,255,255,.28); font-size:11px; }
.spotlight-footer kbd { display:inline-flex; align-items:center; padding:2px 6px; border-radius:5px; background:rgba(255,255,255,.1); color:rgba(255,255,255,.45); font:700 10px "DM Sans"; border:1px solid rgba(255,255,255,.13); }
@media(max-width:760px){.search-trigger{min-width:auto;padding:9px 12px}.search-trigger-label,.search-trigger kbd{display:none}.spotlight{padding-top:8vh}}

/* ── Auditor link in sidebar ── */
a.nav-auditor { text-decoration:none; margin-top:2px; border:1px solid rgba(231,185,94,.24); background:transparent; color:#e7b95e !important; }
a.nav-auditor:hover { background:rgba(231,185,94,.09); border-color:rgba(231,185,94,.36); color:#fff !important; }

/* ── Our Tools section in sidebar ── */
.nav-tools-label { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:rgba(255,255,255,.35); padding:5px 12px 1px; }
a.nav-tool { text-decoration:none; border:1px solid transparent; background:transparent; color:#9fb7c6 !important; }
a.nav-tool:hover { background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.08); color:#fff !important; }
a.nav-tool-desktop { opacity:.7; cursor:default; }
a.nav-tool-desktop:hover { opacity:.85; }

/* ── Auth gate inside main (sidebar always visible) ── */
main > #auth-gate { background: linear-gradient(135deg, #eef3f6, #dde9ef); }
.public-contact-panel { padding: 30px 38px 50px; }
.public-contact-panel[hidden] { display: none; }

/* ── Renewal watch — clickable rows ── */
button.renewal-item { width:100%; text-align:left; background:transparent; border:0; cursor:pointer; font:inherit; color:inherit; }
button.renewal-item:hover { background:#f5f8fa; border-radius:8px; }

/* ── Permit register — row numbers ── */
.row-num-th { width:44px; text-align:center; }
.row-num-td { text-align:center; vertical-align:middle; padding:8px 6px; }
.row-num { display:inline-grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--navy); color:#fff; font-size:11px; font-weight:800; }

/* ── Permit register — file pills ── */
.file-cell { min-width:160px; }
.file-pill { display:inline-flex; align-items:center; gap:4px; padding:4px 9px; border-radius:999px; background:var(--teal-soft); color:var(--teal); font-size:11px; font-weight:700; white-space:nowrap; max-width:200px; overflow:hidden; text-overflow:ellipsis; border:1px solid rgba(46,113,134,.18); margin:2px 2px 2px 0; cursor:pointer; font-family:inherit; }
.file-pill:hover { background:var(--teal); color:#fff; }
.file-pill-empty { color:var(--muted); font-size:13px; }

/* ── Usage log table ── */
.log-table { table-layout:auto; }
.log-time-cell    { white-space:nowrap; font-size:11px; color:var(--muted); padding:10px 12px; }
.log-website-cell { white-space:nowrap; }
.log-user-cell    { font-size:12px; font-weight:600; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.log-detail-cell  { font-size:12px; color:var(--ink); max-width:320px; }

.log-site-tag { display:inline-block; font-size:10px; font-weight:700; padding:3px 8px; border-radius:6px; background:#e8f0f5; color:#3a5f6f; white-space:nowrap; }

.log-pill { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.02em; padding:3px 9px; border-radius:20px; white-space:nowrap; background:#e8f0f5; color:#3a5f6f; }
.lp-add     { background:#e6f7ef; color:#1b7c49; }
.lp-update  { background:#fff8e2; color:#7a5a00; }
.lp-delete  { background:#fde8e8; color:#c0392b; }
.lp-signin  { background:#edf2ff; color:#2c4da8; }
.lp-signout { background:#f0eeff; color:#5c3db8; }

#usage-log-nav-btn { margin-top:0; }
.sidebar-note { margin-top:0; padding:10px 12px; border-radius:10px; }

/* ── Environmental Data — sidebar group ─────────────────────────────────────── */
.nav-group-toggle { display:flex; align-items:center; gap:8px; width:100%; min-height:42px; padding:10px 12px; margin-top:2px; border:0; border-radius:8px; background:transparent; color:inherit; font:inherit; font-size:13px; font-weight:600; cursor:pointer; text-align:left; }
.nav-group-toggle:hover { background:rgba(255,255,255,.07); }
.nav-group-toggle span:first-child { width:18px; text-align:center; font-size:16px; }
.nav-group-caret { margin-left:auto; font-size:10px; opacity:.6; transition:transform .15s ease; }
#env-nav-section.collapsed .nav-group-caret { transform:rotate(-90deg); }
#env-nav-section.collapsed #env-nav { display:none; }
#env-nav { display:flex; flex-direction:column; padding-left:10px; }

/* ── Waste tracker ──────────────────────────────────────────────────────────── */
.waste-periodbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin-bottom:16px; }
.waste-periodbar label { display:flex; flex-direction:column; gap:4px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:#6d7f8a; }
.waste-periodbar select { min-width:130px; padding:9px 10px; border:1px solid #d9e2e6; border-radius:8px; background:#fff; font-size:13px; }
.waste-periodbar .button { margin-left:auto; }
.waste-periodbar .button + .button { margin-left:0; }

.waste-table th, .waste-table td { vertical-align:top; }
.waste-num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.waste-muted { color:#9aa9b2; }
.waste-sub { display:block; color:#8496a0; font-size:11px; }
.waste-remarks { max-width:280px; color:#5d6f79; font-size:12px; }
.waste-record-row { cursor:pointer; }
/* Date + source marker must share one line, or every row costs a second one. */
.waste-table td:first-child, .waste-table th:first-child { white-space:nowrap; }
.waste-record-row:hover { background:#f4f8f9; }
.waste-record-row:focus-visible { outline:2px solid #17324d; outline-offset:-2px; }
.waste-loading { padding:26px 12px; color:#8496a0; text-align:center; }

.waste-group-row td { background:#eef3f5; border-top:1px solid #dbe5e9; }
.waste-group-row.waste-group-depth-1 td { background:#f4f8f9; }
.waste-group-row.waste-group-depth-2 td { background:#f9fbfc; }
.waste-group-toggle { display:flex; align-items:center; gap:8px; width:100%; padding:2px 0; border:0; background:none; font:inherit; font-size:13px; color:#17324d; cursor:pointer; text-align:left; }
.waste-group-depth-1 .waste-group-toggle { padding-left:18px; }
.waste-group-depth-2 .waste-group-toggle { padding-left:36px; }
.waste-group-caret { width:12px; font-size:10px; color:#6d7f8a; }
.waste-group-count { color:#7b8c96; font-size:11px; font-weight:500; }
.waste-group-share { padding-left:14px; color:#7b8c96; font-size:11px; white-space:nowrap; }
.waste-indent-1 { padding-left:28px !important; }
.waste-indent-2 { padding-left:44px !important; }
.waste-indent-3 { padding-left:60px !important; }
.waste-total-row td { position:sticky; bottom:0; background:#17324d; color:#fff; border-top:2px solid #0e2438; font-size:13px; }

.waste-trend { display:flex; align-items:flex-end; gap:6px; height:150px; padding:8px 2px 0; }
.waste-trend-bar { display:flex; flex-direction:column; justify-content:flex-end; flex:1; height:100%; gap:5px; }
.waste-trend-fill { min-height:2px; border-radius:4px 4px 0 0; background:linear-gradient(180deg,#2f6f8f,#17324d); }
.waste-trend-bar.is-empty .waste-trend-fill { height:4px !important; min-height:4px; background:repeating-linear-gradient(45deg,#dbe5e9,#dbe5e9 3px,#eef3f5 3px,#eef3f5 6px); border-radius:2px; }
.waste-trend-bar.is-empty .waste-trend-label { opacity:.5; }
.waste-trend-bar.is-selected .waste-trend-fill { background:linear-gradient(180deg,#f0a538,#d9822b); }
.waste-trend-label { color:#8496a0; font-size:10px; text-align:center; }

.waste-record-meta { display:flex; flex-direction:column; gap:2px; margin-top:6px; color:#8496a0; font-size:11px; }
.waste-warning { color:#b06a12 !important; }
.button.ghost.danger { color:#b0392b; }

@media (max-width:820px) {
  .waste-periodbar { gap:8px; }
  .waste-periodbar label, .waste-periodbar select { flex:1 1 42%; min-width:0; }
  .waste-periodbar .button { flex:1 1 100%; margin-left:0; }
  .waste-table th:nth-child(3), .waste-table td:nth-child(3),
  .waste-table th:nth-child(7), .waste-table td:nth-child(7),
  .waste-table th:nth-child(8), .waste-table td:nth-child(8) { display:none; }
  .waste-trend { height:110px; }
}

/* [hidden] loses to an explicit display rule, so state it — the same fix the
   sidebar already needs for .nav-item[hidden]. */
.module-tabs[hidden] { display: none; }

/* ── Import & Reconcile ─────────────────────────────────────────────────────── */
.import-dropzone { padding:10px 12px; border:1px dashed #cfdce2; border-radius:7px; background:#fbfdfd; }
.import-dropzone input[type=file] { display:block; width:100%; font-size:13px; }
.import-dropzone .source-note { margin-top:8px; }
.import-status { margin-top:8px; padding:6px 10px; border-radius:6px; background:#f4f8f9; color:#5d6f79; font-size:12.5px; }
.import-status.is-dry { background:#fff6e6; color:#8a5a12; font-weight:600; }
.import-status.is-error { background:#fdeceb; color:#a3382b; font-weight:600; }
.import-status.is-ok { background:#e9f6ee; color:#1d6b3d; font-weight:600; }

.import-sheets { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.import-sheet { display:flex; flex-direction:column; gap:1px; min-width:150px; padding:5px 9px; border:1px solid #e2eaed; border-left-width:3px; border-radius:5px; background:#fff; }
.import-sheet strong { font-size:12px; }
.import-sheet small { color:#7b8c96; font-size:11px; }
.import-sheet.is-ok { border-left-color:#2f8f5b; }
.import-sheet.is-warn { border-left-color:#d99a2b; }

.import-counts { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; }
.import-count { display:flex; flex-direction:column; gap:2px; padding:12px 14px; border:1px solid #e2eaed; border-radius:9px; background:#fff; }
.import-count-label { color:#7b8c96; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; }
.import-count-value { font-size:24px; font-weight:700; font-variant-numeric:tabular-nums; }
.import-count small { color:#8496a0; font-size:11px; }
.import-count.is-ok { border-color:#bfe3cd; }
.import-count.is-warn { border-color:#f0dcae; background:#fffcf5; }
.import-count.is-danger { border-color:#f2c9c3; background:#fef8f7; }
.import-count.is-primary { border-color:#17324d; background:#17324d; }
.import-count.is-primary .import-count-label, .import-count.is-primary small { color:rgba(255,255,255,.72); }
.import-count.is-primary .import-count-value { color:#fff; }

.import-review { margin-top:18px; }
.import-review-heading { display:flex; align-items:center; gap:7px; margin:12px 0 5px; font-size:12.5px; font-weight:700; }
.import-review-heading span { padding:1px 7px; border-radius:4px; background:#eef3f5; color:#5d6f79; font-size:10.5px; font-variant-numeric:tabular-nums; }
.import-table { font-size:12px; }
.import-rowref { display:block; color:#9aa9b2; font-size:10px; }
.import-reason { max-width:320px; color:#8a5a12; }
.import-skipped { margin:6px 0 0; padding-left:18px; color:#7b8c96; font-size:12px; }
.import-skipped li { margin-bottom:2px; }

.import-reconcile-block + .import-reconcile-block { margin-top:26px; padding-top:20px; border-top:1px solid #e6edf0; }
.import-badge { padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; letter-spacing:.05em; }
.import-badge.is-ok { background:#e9f6ee; color:#1d6b3d; }
.import-badge.is-warn { background:#fff6e6; color:#8a5a12; }
.import-badge.is-danger { background:#fdeceb; color:#a3382b; }
.import-diff { color:#a3382b; font-weight:700; }
.import-table tr.is-mismatch td { background:#fef8f7; }
.import-table tr.is-source-only td, .import-table tr.is-database-only td { background:#fffcf5; }
.import-note { margin-top:7px; padding:7px 10px; border-radius:6px; background:#fff6e6; color:#8a5a12; font-size:11.5px; }

.import-confirm-panel { border:2px solid #17324d; }
.import-confirm-row { display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.import-confirm-row .button[disabled] { opacity:.45; cursor:not-allowed; }

/* ── Utilities grid ─────────────────────────────────────────────────────────── */
.utility-table { font-size:12px; }
.utility-table th { white-space:nowrap; }
.utility-derived-head { background:#f4f8f9; color:#5d6f79; }
.utility-derived { background:#fafcfd; color:#3d5560; font-variant-numeric:tabular-nums; }
.utility-derived small { color:#9aa9b2; font-size:10px; }
.utility-pending { background:#fffcf5; }
.utility-cell { padding:2px !important; }
.utility-cell input { width:100%; min-width:78px; padding:7px 8px; border:1px solid transparent; border-radius:6px; background:transparent; font:inherit; font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
.utility-cell input:hover { border-color:#dbe5e9; background:#fff; }
.utility-cell input:focus { border-color:#17324d; background:#fff; outline:none; box-shadow:0 0 0 3px rgba(23,50,77,.1); }
.utility-reduction-cell input { background:#fffdf7; }
.utility-empty-row td:first-child { color:#9aa9b2; }
.utility-note { margin-top:12px; padding:10px 12px; border-radius:8px; background:#f4f8f9; line-height:1.5; }
.utility-table input::-webkit-outer-spin-button, .utility-table input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.utility-table input[type=number] { -moz-appearance:textfield; }
@media (max-width:820px) { .utility-cell input { min-width:64px; } }

/* ── Training ───────────────────────────────────────────────────────────────── */
.training-trainers { display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:4px; }
.training-trainer { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:500; }
.training-trainer input { width:auto; margin:0; }
.training-trainers-label { display:block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:#6d7f8a; }
.training-unmapped { color:#b06a12; font-size:11px; }
.training-section { display:inline-block; min-width:26px; padding:1px 5px; border-radius:4px; background:#eef3f5; color:#5d6f79; font-size:10px; font-weight:700; }

/* ── MPR inputs & report ────────────────────────────────────────────────────── */
.mprin-tabs { display:flex; gap:6px; margin-bottom:14px; }
.mprin-tab { padding:8px 16px; border:1px solid #dbe5e9; border-radius:8px; background:#fff; font:inherit; font-size:13px; font-weight:600; color:#5d6f79; cursor:pointer; }
.mprin-tab:hover { background:#f4f8f9; }
.mprin-tab.active { border-color:#17324d; background:#17324d; color:#fff; }
#mpr-sections .panel + .panel { margin-top:18px; }
#mpr-readiness .import-sheet { min-width:210px; }

/* ── Smart Arrange ──────────────────────────────────────────────────────────── */
.waste-conflict-note { margin:12px 22px 16px; }
/* Provenance: present but quiet — it should be findable, not compete with the data. */
.prov-row td { padding:5px 10px; background:#fafcfc; border-top:1px solid var(--line); color:#7b8c96; font-size:11px; }
/* Beats `.portalet-table td small { display:block }`, which would otherwise put
   the source marker on its own line and cost ~18px on every table row. */
.portalet-table td small.prov-mark, .prov-mark { display:inline; margin-left:6px; color:#9fb0b8; font-size:10px; letter-spacing:.01em; white-space:nowrap; }
.prov-mark.is-imported { color:#7f9aa8; }
.prov-footer { margin-top:8px; }
.smart-form { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.smart-input-box { flex:1 1 380px; }
.smart-examples { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.smart-example { padding:3px 9px; border:1px solid #dbe5e9; border-radius:12px; background:#fff; font:inherit; font-size:11.5px; color:#5d6f79; cursor:pointer; }
.smart-example:hover { border-color:#17324d; color:#17324d; background:#f4f8f9; }

.smart-interpretation { border-left:3px solid #2f6f8f; }
.smart-chips { display:flex; flex-wrap:wrap; gap:6px; }
.smart-chip { padding:2px 8px; border-radius:4px; background:#eef3f5; font-size:11.5px; color:#3d5560; }
.smart-chip b { color:#17324d; font-weight:700; }
.smart-chip i { color:#8496a0; font-style:normal; font-size:11px; }
.smart-unresolved { margin:6px 0 0; padding-left:18px; }
.smart-unresolved li { margin-bottom:3px; }

.smart-headline { display:flex; flex-wrap:wrap; align-items:baseline; gap:18px; padding:8px 0 10px; }
.smart-headline small { display:block; color:#8496a0; font-size:12px; margin-top:2px; }
.smart-figure { font-size:24px; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.smart-figure.secondary { font-size:18px; color:#7b8c96; }
.smart-unit { font-size:16px; color:#7b8c96; }
.smart-delta { padding:4px 9px; border-radius:5px; background:#f4f8f9; font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.smart-delta.up { background:#fdeceb; color:#a3382b; }
.smart-delta.down { background:#e9f6ee; color:#1d6b3d; }
.smart-delta small { font-weight:500; font-size:11px; }

.smart-explain { margin-top:10px; padding-top:9px; border-top:1px solid #e6edf0; }
.smart-steps { margin:5px 0 7px; padding-left:17px; }
.smart-step { margin-bottom:2px; font-size:12.5px; color:#3d5560; line-height:1.4; }
.smart-step.is-figure { font-weight:700; color:#17324d; }
.smart-step.is-caveat { color:#8a5a12; }
.smart-child td:first-child { padding-left:22px; color:#5d6f79; }

.smart-finding { padding:8px 0; border-bottom:1px solid #eef3f5; }
.smart-finding:last-of-type { border-bottom:0; }
.smart-finding-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:4px; }
.smart-finding p { margin:0 0 6px; color:#5d6f79; font-size:13px; }

/* ── MPR flexible monthly content ─────────────────────────────────────────── */

.mpr-toggle { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#555; }
.mpr-toggle input { margin:0; }

.mpr-block { padding:10px 12px; margin:8px 0; }
.mpr-block-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.mpr-block-head .eyebrow { margin:0; text-transform:uppercase; letter-spacing:.04em; }
.mpr-block-tools { display:flex; align-items:center; gap:4px; }
.mpr-block-tools .button { padding:2px 8px; line-height:1.6; }
.mpr-drag { cursor:grab; padding:2px 6px; color:#999; user-select:none; }
.mpr-drag:active { cursor:grabbing; }

.mpr-text { width:100%; font:inherit; line-height:1.55; padding:10px 12px;
  border:1px solid #dcdcdc; border-radius:8px; resize:vertical; }

/* Photographs render from thumbnails; the full-resolution file is never
   loaded into the grid, so a 50-photo month stays cheap to display. */
.mpr-photo { display:flex; gap:14px; align-items:flex-start; }
.mpr-photo img { width:180px; height:135px; object-fit:cover; border-radius:8px;
  background:#f2f2f2; flex:0 0 auto; }
.mpr-photo-meta { display:flex; flex-direction:column; gap:8px; flex:1 1 auto; min-width:0; }
.mpr-photo-meta input, .mpr-file input { width:100%; font:inherit; padding:8px 10px;
  border:1px solid #dcdcdc; border-radius:8px; }

.mpr-file { display:flex; flex-direction:column; gap:6px; }
.mpr-file small { color:#777; }
.mpr-raw { background:#fafafa; border-radius:6px; padding:8px; overflow:auto; font-size:11.5px; }

#mpr-content[data-editable="no"] .mpr-block-tools,
#mpr-content[data-editable="no"] .waste-periodbar button,
#mpr-content[data-editable="no"] .mpr-toggle { display:none; }
#mpr-content[data-editable="no"] .mpr-text,
#mpr-content[data-editable="no"] input { pointer-events:none; background:#fafafa; }

@media (max-width: 700px) {
  .mpr-photo { flex-direction:column; }
  .mpr-photo img { width:100%; height:auto; }
}


/* ── Consistency pass ─────────────────────────────────────────────────────
   One radius scale (4 / 6 / 9), one control height (30px), one badge shape,
   one empty-state treatment. Values only — no layout is redefined here. */
.portalet-table, .waste-table, .utility-table, .import-table { font-size:13px; }
.utility-table, .import-table { font-size:12px; }
.waste-sub { display:block; color:#8496a0; font-size:10.5px; line-height:1.3; }
.waste-muted { color:#98a8b0; }
/* .waste-total-row keeps its own dark sticky treatment (see above): setting a
   pale background here left the white text invisible. Only the weight is
   normalised, never the colours. */
.waste-total-row td, tr.waste-total-row td { font-weight:700; }
.utility-derived, .utility-derived-head { background:#fbfdfd; }
.utility-empty-row td { color:#a8b6bd; }
/* Numbers, dates and counters align the same way in every table. */
.waste-num, .row-num-td { font-variant-numeric:tabular-nums; }
.source-note { font-size:11px; color:#8496a0; line-height:1.45; margin:5px 0 0; }
.empty-list, .empty-state { padding:16px; font-size:12px; color:#8496a0; }
/* Narrative and report prose keeps a readable measure on a wide monitor. */
.portalet-hero p:last-child, .source-note, .import-note { max-width:78ch; }
/* A <select> is sized by its longest option, which pushed the Training filter
   to 532px and widened the whole page at 375px. Nothing may exceed its column. */
select, input, textarea { max-width:100%; }
.register-tools select, .register-tools .search-box { min-width:0; }
.register-tools select { max-width:220px; text-overflow:ellipsis; }


/* ── Mobile ───────────────────────────────────────────────────────────────
   portal.css loads after styles.css, so the desktop .nav-item compaction here
   was overriding the mobile block there. Field entry needs a real touch
   target, so mobile deliberately stays looser than desktop. */
@media (max-width: 760px) {
  /* Matches `.sidebar .nav-item` (0,2,0) above, which a bare .nav-item loses to. */
  .sidebar .nav-item { min-height:40px; padding:9px 11px; font-size:14px; }
  .sidebar .nav-item span { width:20px; flex:0 0 20px; font-size:16px; }
  .table-wrap { max-height:none; }
  .portalet-hero { flex-direction:column; align-items:stretch; gap:8px; }
  .portalet-asof { min-width:0; }
  .portalet-dashboard-grid { grid-template-columns:1fr; }
  .stat-card { padding:8px 10px; }
  .smart-figure { font-size:20px; }
}

/* Fuel / Wastewater / Trees capture */
.mprin-unit { margin-left:6px; font-weight:400; color:#8496a0; font-size:10px; text-transform:none; letter-spacing:0; }
.mprin-tree-summary { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:520px; margin-bottom:10px; }
#mprin-form-fields label { position:relative; }
#mprin-form-hint { flex:1; }

/* ── BRIMAJ purchase-order consumption ─────────────────────────────────────
   Reuses the register's existing list/bar/pill vocabulary; only the figures
   block and the save preview need styles of their own. */
.subcon-po-row { padding:7px 0; border-bottom:1px solid #edf1f2; }
.subcon-po-row:last-child { border-bottom:0; }
.subcon-po-row .location-row { align-items:baseline; }
.subcon-po-head { display:flex; align-items:baseline; gap:8px; }
.subcon-po-head strong { font-size:13px; }
.subcon-po-figures { display:flex; flex-wrap:wrap; gap:4px 18px; margin:4px 0 5px; font-size:11.5px; color:var(--muted); }
.subcon-po-figures span { font-variant-numeric:tabular-nums; }
.subcon-po-figures b { color:var(--ink); font-weight:700; }
.subcon-po-pct { font-variant-numeric:tabular-nums; font-weight:700; font-size:11.5px; }
.subcon-po-balance { font-variant-numeric:tabular-nums; font-weight:800; font-size:12.5px; color:var(--ink); }
.subcon-po-caption { font-size:10.5px; color:var(--muted); }
.bar i.is-nearly { background:var(--amber); }
.bar i.is-full { background:var(--navy); }
.bar i.is-over { background:var(--red); }
.bar i.is-superseded { background:#9aa7ad; }

.subcon-po-summary, .subcon-po-preview { margin:0 24px 12px; border:1px solid var(--line); border-radius:8px; padding:10px 12px; background:#f8faf9; font-size:12px; }
.subcon-po-summary:empty { display:none; }
.subcon-po-summary dl, .subcon-po-preview dl { display:grid; grid-template-columns:auto auto; gap:3px 14px; margin:0; }
.subcon-po-summary dt, .subcon-po-preview dt { color:var(--muted); font-size:11.5px; }
.subcon-po-summary dd, .subcon-po-preview dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; font-weight:700; }
.subcon-po-preview { background:var(--teal-soft); border-color:#bcd6dd; }
.subcon-po-preview.is-blocked { background:var(--red-soft); border-color:#efc5bf; }
.subcon-po-preview .subcon-po-preview-title { font-weight:800; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--teal); margin:0 0 7px; }
.subcon-po-preview.is-blocked .subcon-po-preview-title { color:var(--red); }
.subcon-po-preview pre { margin:0; font:inherit; white-space:pre-wrap; color:#7f3229; }
.subcon-po-new { border-top:1px dashed var(--line); margin:0 0 4px; }
.subcon-po-note { margin:0 24px 10px; font-size:11px; color:var(--muted); line-height:1.45; }

/* `.button` sets display:inline-flex, which outranks the UA rule for [hidden]
   — so a hidden dialog button stays visible without this. */
.button[hidden] { display: none; }

/* Liquid waste register — one row per record, actions on the row. */
.waste-actions { white-space:nowrap; text-align:right; }
.waste-actions-head { text-align:right; }
.waste-actions .text-button { padding:2px 6px; font-size:12px; }
.waste-actions .text-button + .text-button { margin-left:6px; }
.location-item.location-total { margin-top:10px; padding-top:10px; border-top:1px solid var(--line,#e2e5ea); }
.location-item.location-total .location-row { font-size:14px; }
