:root {
  font-family: "DM Sans", sans-serif;
  color: #202920;
  background: #f5f7f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #007F73;
  --brand: #00BEAC;
  --green-dark: #073B3A;
  --green-soft: #E0F7F4;
  --muted: #758077;
  --line: #e8ece7;
  --surface: #fff;
  --amber: #9a6716;
  --red: #a44439;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }

.shell { min-height: 100vh; display: flex; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--green-dark); color: #fff; padding: 27px 16px 20px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; margin-bottom: 42px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; object-fit: cover; background: #fff; }
.brand-name { font: 800 15px Manrope, sans-serif; letter-spacing: -.5px; white-space: nowrap; }
.brand-sub { color: #a9bcae; text-transform: uppercase; font-size: 9px; letter-spacing: 1.3px; margin-top: 2px; }
.nav-label { color: #8fa594; padding: 0 12px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: 1.1px; font-size: 10px; font-weight: 700; }
.nav-list { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; color: #bdcabe; text-align: left; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.nav-item:hover { color: #fff; background: #ffffff12; }
.nav-item.active { color: #fff; background: #ffffff1c; }
.nav-icon { width: 19px; height: 19px; display: grid; place-items: center; opacity: .9; font-size: 16px; }
.sidebar-bottom { margin-top: auto; }
.connection { padding: 13px; margin: 0 4px 14px; background: #ffffff0d; border: 1px solid #ffffff14; border-radius: 10px; }
.connection-label { color: #a9bcae; text-transform: uppercase; letter-spacing: .9px; font-size: 9px; font-weight: 700; }
.connection-value { color: #e8f1e8; font-size: 11px; margin-top: 7px; overflow-wrap: anywhere; }
.side-button { width: 100%; border: 0; color: #ced9cf; background: transparent; text-align: left; padding: 10px 12px; font-size: 12px; border-radius: 8px; }
.side-button:hover { background: #ffffff12; color: #fff; }

.main { position: relative; isolation: isolate; min-width: 0; flex: 1; }
.main::before { content: ""; position: absolute; z-index: -1; top: 104px; right: 14px; width: min(55vw, 560px); aspect-ratio: 1; background: url("./icons/substrate-logo.png") center / contain no-repeat; opacity: .055; mix-blend-mode: multiply; pointer-events: none; }
.topbar { height: 76px; border-bottom: 1px solid var(--line); background: #ffffffba; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: #3b453d; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.top-user { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #536056; }
.back-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); cursor: pointer; font-size: 22px; line-height: 1; transition: background .15s, border-color .15s; }
.back-button:hover { border-color: var(--green); background: var(--green-soft); }
.back-button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.settings-panel { margin-bottom: 17px; }
.settings-section-title { margin: 24px 0 12px; font: 800 16px Manrope, sans-serif; color: #263329; }
.csv-import-form { max-width: 560px; }
.csv-actions { flex-wrap: wrap; justify-content: flex-start; gap: 9px; }
.csv-result { margin: 14px 0; }
.csv-result ul { margin: 6px 0 0; padding-left: 18px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); font-weight: 700; font-size: 11px; }
.content { max-width: 1280px; padding: 34px 42px 56px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 27px; }
.eyebrow { color: var(--green); text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 800 28px Manrope, sans-serif; letter-spacing: -1px; margin-bottom: 7px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0; }
.button { border: 1px solid transparent; border-radius: 8px; padding: 10px 14px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button-primary { color: var(--green-dark); background: var(--brand); }
.button-primary:hover { background: #00AA9A; }
.button-secondary { color: #344339; background: #fff; border-color: #dfe5de; }
.button-secondary:hover { border-color: #bac8bc; background: #fafcf9; }
.button-danger { color: var(--red); background: #fff; border-color: #f0d7d3; }
.button-small { padding: 7px 10px; font-size: 11px; }
.button-link { background: none; border: 0; color: var(--green); padding: 5px; font-size: 11px; font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card, .panel { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.stat-card { padding: 18px 19px; min-height: 113px; }
.stat-card-interactive { position: relative; cursor: pointer; }
.stat-card-open { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.stat-card-open:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.my-assignments-dialog { width: min(100% - 28px, 900px); overflow-y: auto; }
.my-assignments-dialog .modal { padding: 24px; }
.my-assignments-dialog .modal-heading .subtitle { margin-top: 6px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 14px; }
.stat-value { font: 800 26px Manrope, sans-serif; letter-spacing: -.8px; margin-top: 8px; }
.stat-note { color: var(--muted); font-size: 10px; margin-top: 2px; }
.inventory-search-panel { margin-bottom: 17px; }
.inventory-search-panel .panel-heading { margin-bottom: 13px; }
.inventory-search-controls { display: flex; gap: 9px; }
.inventory-search-controls input { min-width: 0; flex: 1; border: 1px solid #dfe5df; border-radius: 8px; outline: none; padding: 10px 12px; color: #29362c; background: #fff; font-size: 12px; }
.inventory-search-controls input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #00BEAC33; }
.scan-barcode-button { min-width: 174px; min-height: 52px; padding: 10px 18px; font-size: 14px; }
.scan-barcode-icon { font-size: 21px; line-height: 1; }
.dashboard-quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.dashboard-quick-link { min-height: 112px; display: flex; align-items: center; gap: 17px; padding: 20px 22px; border: 1px solid #d9e8e2; border-radius: 12px; background: #fff; color: #263329; text-align: left; box-shadow: 0 3px 12px #073b3a0a; transition: border-color .15s, transform .15s, box-shadow .15s; }
.dashboard-quick-link:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 7px 20px #073b3a12; }
.dashboard-quick-link:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.dashboard-quick-link-icon { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 27px; }
.dashboard-quick-link > span:nth-child(2) { display: grid; flex: 1; gap: 5px; }
.dashboard-quick-link strong { font: 800 19px Manrope, sans-serif; }
.dashboard-quick-link small { color: var(--muted); font-size: 12px; }
.dashboard-quick-link-arrow { color: var(--green); font-size: 22px; }
.install-app-card { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #b8e8e2; border-radius: 12px; background: linear-gradient(115deg, #effbf8, #fff); }
.install-app-icon { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: var(--green-dark); color: var(--brand); font: 800 12px Manrope, sans-serif; }
.install-app-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.install-app-copy strong { color: #263329; font: 700 13px Manrope, sans-serif; }
.install-app-copy span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.install-app-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.install-instructions > p { color: #536056; font-size: 13px; line-height: 1.6; }
.search-hint { color: var(--muted); font-size: 11px; margin: 11px 0 0; }
.search-results { display: grid; gap: 5px; margin-top: 10px; }
.search-result { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; }
.search-result:hover, .search-result:focus-visible { border-color: #bac8bc; background: #fafcf9; outline: none; }
.search-result-type { min-width: 45px; color: var(--green); text-transform: uppercase; letter-spacing: .5px; font-size: 9px; font-weight: 700; }
.search-result-info { min-width: 0; flex: 1; }
.search-result-info .secondary-cell { overflow-wrap: anywhere; }
.search-result-arrow { color: var(--green); font-size: 15px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.search-result-highlight td { background: var(--green-soft); }
.search-result-highlight td:first-child { box-shadow: inset 3px 0 var(--brand); }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 17px; }
.panel { padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { font: 700 15px Manrope, sans-serif; margin: 0; }
.panel-heading p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { border-bottom: 1px solid var(--line); color: #879087; text-transform: uppercase; letter-spacing: .65px; font-size: 9px; font-weight: 700; padding: 10px 9px; white-space: nowrap; }
td { border-bottom: 1px solid #eff2ee; padding: 12px 9px; color: #49534a; font-size: 11px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.primary-cell { color: #263329; font-weight: 700; font-size: 11px; }
.secondary-cell { color: #8b948b; font-size: 10px; margin-top: 3px; }
.item-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.item-cell-details { min-width: 0; }
.item-photo-link { display: block; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 7px; overflow: hidden; background: #f1f4f0; }
.item-photo-link:focus-visible, .item-profile-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.item-photo { display: block; width: 48px; height: 48px; object-fit: cover; }
.item-photo-placeholder { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 7px; background: #f1f4f0; color: #89928a; font-size: 8px; }
.item-profile-link { display: inline; padding: 0; border: 0; background: transparent; color: #263329; font-size: 11px; font-weight: 700; text-align: left; }
.item-profile-link:hover { color: var(--green); text-decoration: underline; }
.item-profile-dialog { width: min(100% - 28px, 760px); overflow-y: auto; }
.item-profile { padding: 24px; }
.item-profile .modal-heading { align-items: center; }
.item-profile .modal-heading h2 { font-size: 22px; }
.item-profile .eyebrow { margin-bottom: 5px; }
.item-profile-image-link { display: grid; place-items: center; min-height: 150px; max-height: 440px; margin-bottom: 18px; overflow: hidden; border-radius: 9px; background: #f1f4f0; }
.item-profile-image { display: block; max-width: 100%; width: auto; height: auto; max-height: 440px; object-fit: contain; }
.item-profile-no-image { display: grid; min-height: 150px; place-items: center; margin-bottom: 18px; border-radius: 9px; background: #f1f4f0; color: #89928a; font-size: 12px; }
.item-profile-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.item-profile-detail { min-width: 0; padding: 10px 0; border-bottom: 1px solid #eff2ee; }
.item-profile-detail dt { color: var(--muted); font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.item-profile-detail dd { color: #29362c; font-size: 12px; overflow-wrap: anywhere; margin: 0; }
.item-history-section { margin-top: 22px; }
.item-history-section .panel-heading { margin-bottom: 10px; }
.item-history-section .panel-heading h3 { margin-bottom: 4px; font: 700 14px Manrope, sans-serif; }
.item-history-section .panel-heading p { color: var(--muted); font-size: 10px; margin: 0; }
.history-more { display: flex; justify-content: center; margin-top: 14px; }
.history-live { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 700; }
.history-live span { width: 8px; height: 8px; border-radius: 50%; background: #21a67a; box-shadow: 0 0 0 3px #21a67a22; }
.history-live-offline { color: var(--muted); }
.history-live-offline span { background: #b68733; box-shadow: 0 0 0 3px #b6873322; }
.note-content { max-width: 520px; margin-top: 5px; color: #59655b; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.note-attachment { color: var(--green); font-size: 10px; font-weight: 600; }
.note-attachment-image { display: inline-grid; justify-items: start; gap: 3px; text-decoration: none; }
.note-attachment-image img { width: 68px; height: 54px; border-radius: 5px; object-fit: cover; }
.note-attachment-image span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-attachment-error { color: var(--red); }
.note-existing-attachments { margin: 8px 0 0; padding-left: 18px; font-size: 11px; }
.note-existing-attachments a { color: var(--green); }
.item-profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 30px; padding: 5px 8px; font-size: 9px; font-weight: 700; white-space: nowrap; background: #eef2ed; color: #57635a; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-good { color: #08796F; background: #E7F7F4; }
.badge-warn { color: var(--amber); background: #fbf3e4; }
.badge-bad { color: var(--red); background: #fbefed; }
.low-stock { color: var(--red); font-weight: 700; }
.stock-hold-status { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid #dfe8df; border-radius: 7px; background: #f6f8f5; color: #526052; font-size: 10px; line-height: 1.45; }
.stock-hold-status.has-expiring { border-color: #e8c98b; background: #fff8e8; }
.stock-hold-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #e4e9e2; padding-top: 6px; }
.stock-hold-entry > div:first-child { display: grid; gap: 2px; }
.stock-hold-entry.expiring { color: #79500a; }
.stock-hold-warning { color: #9a5a00; }
.stock-hold-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-hold-actions .button-link { font-size: 10px; }
.stock-hold-expiring-row { background: #fffaf0; }
.stock-hold-expiring-row td { border-bottom-color: #f1dfba; }
.empty { color: #89928a; text-align: center; padding: 30px 12px; font-size: 12px; }
.empty strong { display: block; color: #4e5a50; font-size: 13px; margin-bottom: 5px; }
.employee-list { display: grid; gap: 2px; }
.employee-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eff2ee; }
.employee-row:last-child { border-bottom: 0; }
.employee-initial { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #edf3ed; color: var(--green); font-size: 10px; font-weight: 700; flex: 0 0 30px; }
.employee-detail { min-width: 0; flex: 1; }
.employee-name { font-weight: 700; font-size: 11px; }
.employee-meta { color: var(--muted); font-size: 10px; margin-top: 3px; }
.employee-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.list-panel { padding: 0; overflow: hidden; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.list-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.list-panel > .panel-heading { padding: 18px 18px 0; }
.list-count { color: var(--muted); font-size: 11px; }
.list-search { padding: 13px 18px 0; }
.list-search input { display: block; width: 100%; border: 1px solid #dfe5df; border-radius: 8px; outline: none; padding: 10px 12px; color: #29362c; background: #fff; font-size: 12px; }
.list-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #00BEAC33; }
.list-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.list-filter { display: grid; gap: 5px; min-width: 130px; color: var(--muted); font-size: 10px; font-weight: 600; }
.list-filter select { min-width: 0; max-width: 220px; border: 1px solid #dfe5df; border-radius: 7px; padding: 8px 28px 8px 9px; color: #29362c; background: #fff; font-size: 11px; }
.list-filter select:focus { outline: 2px solid #00BEAC55; border-color: var(--brand); }
.table-full { padding: 0 10px 4px; }
.table-full td, .table-full th { padding-left: 10px; padding-right: 10px; }
.action-cell { text-align: right; white-space: nowrap; }
.action-cell .button-link + .button-link { margin-left: 5px; }
.section-title { font: 700 14px Manrope, sans-serif; }
.help-text { font-size: 11px; color: var(--muted); line-height: 1.55; }
.safety-upload-panel, .incident-reports-panel { margin-top: 17px; }
.safety-upload-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 0 12px; }
.safety-upload-form .field { min-width: 0; }
.safety-upload-form .button { justify-self: start; margin-bottom: 14px; }
.safety-upload-form .form-error { grid-column: 1 / -1; }
.hs-form-intro { color: var(--muted); background: #f4f7f3; border-radius: 7px; padding: 11px 13px; margin: 8px 0; font-size: 11px; line-height: 1.5; }
.hs-section { border-bottom: 1px solid var(--line); padding: 15px 0 7px; margin: 4px 0 0; }
.hs-section h3 { font: 700 13px Manrope, sans-serif; margin: 0 0 4px; }
.hs-section p { color: var(--muted); font-size: 10px; margin: 0 0 4px; }
.hs-checkbox-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; margin: 10px 0; }
.hs-checkbox-group legend { padding: 0 5px; color: #49554b; font-size: 11px; font-weight: 700; }
.hs-checkbox-group > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.hs-checkbox-group label, .hs-other-person label { display: inline-flex; align-items: center; gap: 6px; color: #49554b; font-size: 10px; }
.hs-checkbox-group input, .hs-other-person input[type="checkbox"], .hs-declaration input { width: 15px; height: 15px; flex: 0 0 auto; margin: 0; accent-color: var(--green); }
.hs-other-people { display: grid; gap: 8px; margin: 8px 0; }
.hs-other-person { display: grid; grid-template-columns: minmax(120px, 1fr) repeat(6, auto) minmax(120px, 1fr); align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.hs-other-person-name, .hs-other-person > label:last-child { display: grid; gap: 5px; color: #49554b; font-size: 10px; font-weight: 700; }
.hs-other-person input:not([type="checkbox"]) { min-width: 0; width: 100%; border: 1px solid #dfe5df; border-radius: 6px; padding: 7px; font-size: 10px; }
.hs-declaration { display: flex; align-items: flex-start; gap: 8px; color: #49554b; font-size: 11px; line-height: 1.5; margin: 15px 0 5px; }
.incident-report-dialog { width: min(100% - 28px, 940px); overflow-y: auto; }
.incident-report-dialog .modal { padding: 24px; }
.incident-report-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.incident-report-details > div { border-bottom: 1px solid #eff2ee; padding: 10px 0; min-width: 0; }
.incident-report-details dt { color: var(--muted); font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.incident-report-details dd { color: #29362c; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; }
.vehicle-history-panel { margin-top: 17px; }
.vehicle-error { margin: 14px 18px; }
.vehicle-check-details { padding: 6px 0; }
.vehicle-check-details summary { color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.vehicle-check-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 0; }
.vehicle-check-detail-grid h3 { margin-bottom: 8px; font: 700 12px Manrope, sans-serif; }
.vehicle-check-detail-grid p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.vehicle-checklist { display: grid; gap: 6px; list-style: none; padding: 0; margin: 0; }
.vehicle-checklist li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; background: #f7f9f6; border-radius: 6px; color: #49534a; font-size: 10px; }
.vehicle-checklist li strong { white-space: nowrap; }
.vehicle-photos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.vehicle-photos a { min-width: 0; color: var(--green); text-align: center; font-size: 10px; text-decoration: none; }
.vehicle-photos img, .vehicle-photo-preview { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 7px; object-fit: cover; background: #f1f4f0; }
.vehicle-tool-checklist { display: grid; gap: 7px; }
.vehicle-tool-check { display: grid; grid-template-columns: minmax(130px, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.vehicle-tool-info { display: grid; gap: 3px; min-width: 0; font-size: 10px; }
.vehicle-tool-info strong { overflow-wrap: anywhere; }
.vehicle-tool-info span, .vehicle-photo-field small { color: var(--muted); font-size: 9px; }
.vehicle-tool-presence { display: inline-flex; align-items: center; gap: 6px; color: #29362c; font-size: 10px; font-weight: 600; cursor: pointer; }
.vehicle-tool-presence input { width: 16px; height: 16px; accent-color: var(--green); }
.vehicle-photo-field input { min-width: 0; width: 100%; border: 1px solid #dfe5df; border-radius: 7px; padding: 8px; background: #fff; color: #29362c; font-size: 10px; }
.vehicle-tool-presence input:focus-visible, .vehicle-photo-field input:focus { outline: 2px solid #00BEAC55; border-color: var(--brand); }
.vehicle-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vehicle-photo-field { display: grid; align-content: start; gap: 6px; min-width: 0; color: #49554b; font-size: 10px; font-weight: 700; }
.vehicle-photo-field input { font-weight: 400; }
.vehicle-photo-field small { font-weight: 400; }
.vehicle-photo-preview { max-height: 130px; }
.vehicle-detail-row > td { padding-top: 0; }

.setup-screen, .auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, #e8efe7, #f5f7f4 60%); }
.setup-card, .auth-card { width: min(100%, 460px); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: 0 18px 60px #25472b0b; }
.setup-card .brand, .auth-card .brand { color: #203b2a; margin: 0 0 25px; padding: 0; }
.setup-card h1, .auth-card h1 { font-size: 24px; }
.field { display: grid; gap: 6px; margin: 14px 0; }
.field label { color: #49554b; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dfe5df; border-radius: 7px; outline: none; padding: 10px 11px; color: #29362c; background: #fff; font-size: 12px; }
.remember-session { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; color: #49554b; font-size: 11px; }
.remember-session input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.field textarea { min-height: 74px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #00BEAC33; }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.form-error, .notice { border-radius: 7px; padding: 10px 12px; font-size: 11px; line-height: 1.5; }
.form-error { display: none; color: #923c32; background: #fbefed; border: 1px solid #f1d7d3; margin: 12px 0; }
.form-error.visible { display: block; }
.notice { color: #526052; background: #f4f7f3; border: 1px solid var(--line); margin: 14px 0; }
.auth-footer { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 18px 0 0; }

.note-editor-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); background: #17241b78; }
.note-editor-overlay:focus { outline: none; }
.note-editor-modal { width: min(100%, 490px); max-height: 90vh; max-height: 90dvh; overflow-y: auto; border-radius: 13px; background: var(--surface); box-shadow: 0 24px 90px #101a1260; }

dialog { border: 0; border-radius: 13px; padding: 0; width: min(100% - 28px, 490px); max-height: 90vh; box-shadow: 0 24px 90px #101a1260; }
dialog::backdrop { background: #17241b78; backdrop-filter: blur(2px); }
.modal { padding: 23px 24px; }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.modal-heading h2 { font: 800 19px Manrope, sans-serif; letter-spacing: -.4px; margin: 0 0 5px; }
.modal-heading p { color: var(--muted); font-size: 11px; margin: 0; }
.modal-close { border: 0; color: #6d776e; background: #f2f5f1; width: 29px; height: 29px; border-radius: 50%; font-size: 18px; line-height: 1; }
.scanner-dialog { width: min(100% - 28px, 560px); }
.scanner-modal { padding: 22px; }
.barcode-video { display: block; width: 100%; max-height: 58vh; min-height: 220px; object-fit: cover; border-radius: 9px; background: #17241b; }
.scanner-status { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 12px 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.span-2 { grid-column: span 2; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 5; padding: 12px 16px; color: #fff; background: #263a2b; border-radius: 9px; box-shadow: 0 8px 30px #17251b35; font-size: 12px; max-width: min(440px, calc(100vw - 44px)); }
.toast.error { background: #923c32; }
.loading { color: var(--muted); padding: 32px 0; font-size: 12px; }
.mobile-menu { display: none; }

@media (max-width: 1000px) {
  .sidebar { width: 210px; flex-basis: 210px; }
  .topbar { padding: 0 26px; }
  .content { padding: 28px 26px 45px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { width: 100%; height: auto; padding: 12px 14px; }
  .brand { margin: 0; }
  .sidebar .nav-label, .sidebar-bottom { display: none; }
  .sidebar .nav-list { margin-top: 12px; display: flex; overflow-x: auto; gap: 4px; }
  .nav-item { flex: 0 0 auto; padding: 8px 10px; font-size: 11px; }
  .nav-icon { width: 15px; }
  .topbar { height: 52px; padding: 0 17px; }
  .topbar-actions { gap: 10px; }
  .top-user { gap: 6px; }
  .back-button { width: 34px; height: 34px; }
  .content { padding: 25px 16px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  h1 { font-size: 24px; }
  .stats { gap: 10px; }
  .stat-card { padding: 13px; min-height: 102px; }
  .stat-value { font-size: 23px; }
  .panel { padding: 15px; }
  .list-panel { padding: 0; }
  .list-toolbar { padding: 13px; }
  .list-toolbar-actions { gap: 6px; }
  .list-panel > .panel-heading { padding: 15px 13px 0; }
  .list-search { padding: 13px 13px 0; }
  .list-filters { align-items: stretch; padding: 13px; }
  .list-filter { min-width: calc(50% - 5px); flex: 1; }
  .list-filter select { width: 100%; max-width: none; }
  .vehicle-tool-check { grid-template-columns: minmax(0, 1fr) auto; }
  .vehicle-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-check-detail-grid { grid-template-columns: 1fr; }
  .safety-upload-form { grid-template-columns: 1fr; }
  .hs-checkbox-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-other-person { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-other-person-name, .hs-other-person > label:last-child { grid-column: span 2; }
  .incident-report-details { grid-template-columns: 1fr; }
  .incident-report-dialog .modal { padding: 18px; }
  .item-profile { padding: 18px; }
  .item-profile-details { grid-template-columns: 1fr; }
  .item-profile-image-link { min-height: 120px; }
  .vehicle-check-detail-grid .span-2 { grid-column: auto; }
  .modal { padding: 20px 17px; }
  .scanner-modal { padding: 18px 16px; }
  .inventory-search-controls { align-items: stretch; flex-direction: column; }
  .scan-barcode-button { width: 100%; }
  .dashboard-quick-links { grid-template-columns: 1fr; gap: 10px; }
  .dashboard-quick-link { min-height: 96px; gap: 11px; padding: 14px; }
  .dashboard-quick-link-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 23px; }
  .dashboard-quick-link strong { font-size: 16px; }
  .dashboard-quick-link small { font-size: 10px; }
  .install-app-card { align-items: flex-start; flex-wrap: wrap; padding: 14px; }
  .install-app-copy { flex-basis: calc(100% - 62px); }
  .install-app-actions { width: 100%; justify-content: flex-start; padding-left: 58px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

.inventory-photo-picker input[type="file"] { width: 100%; padding: 10px; border: 1px solid #dfe5df; border-radius: 8px; background: #fff; color: #49534a; font-size: 12px; }
.inventory-photo-preview { display: grid; width: min(100%, 320px); min-height: 150px; place-items: center; overflow: hidden; border: 1px dashed #cfd9cf; border-radius: 9px; background: #f7f9f6; color: var(--muted); font-size: 11px; }
.inventory-photo-preview img { display: block; width: 100%; max-height: 240px; object-fit: contain; }
.inventory-photo-remove { display: flex; align-items: center; gap: 8px; width: fit-content; color: var(--red); font-size: 12px; }
.inventory-photo-remove input { accent-color: var(--red); }
.photo-error { margin: 12px 0; color: var(--amber); overflow-wrap: anywhere; }
.stock-catalog-picker { gap: 9px; }
.catalog-results { display: grid; gap: 6px; max-height: 290px; overflow-y: auto; }
.catalog-result { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; }
.catalog-result:hover, .catalog-result:focus-visible { border-color: #bac8bc; background: #fafcf9; outline: none; }
.catalog-result > img, .catalog-thumb { flex: 0 0 42px; width: 42px; height: 42px; object-fit: cover; border-radius: 6px; background: #f1f4f0; }
.catalog-result > span:last-child { display: grid; min-width: 0; gap: 3px; }
.catalog-result small { color: var(--muted); font-size: 10px; }
.catalog-thumb-empty { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 6px; background: #f1f4f0; color: var(--muted); }
.catalog-create-panel { display: grid; gap: 10px; padding: 14px; border: 1px solid #dfe5de; border-radius: 10px; background: #fafcf9; }
.catalog-create-panel > .field-help { margin: 0; }
.catalog-create-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.catalog-create-fields[hidden] { display: none; }
.combo { position: relative; }
.combo input { padding-right: 42px; }
.combo-toggle { position: absolute; top: 0; right: 0; width: 42px; height: 100%; border: 0; background: transparent; color: #5c6b60; font-size: 16px; cursor: pointer; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow-y: auto; border: 1px solid #dfe5df; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px #1d2b2024; -webkit-overflow-scrolling: touch; }
.combo-list[hidden] { display: none; }
.combo-option { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-bottom: 1px solid #eef2ee; background: #fff; color: #29362c; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.combo-option:hover, .combo-option:focus { background: #e9f8f6; }
.combo-add { color: var(--brand-dark, #007d70); font-weight: 600; }
.combo-empty { padding: 12px; color: #6b7a6f; font-size: 13px; }
.repository-dialog { width: min(100% - 28px, 1040px); max-height: calc(100vh - 32px); overflow-y: auto; }
.repository-dialog .modal { padding: 24px; }

[data-catalog-match][hidden] { display: none; }
