:root {
  --color-bg: #F2F4F3;
  --color-panel: #FFFFFF;
  --color-ink: #1B2430;
  --color-ink-muted: #5B6570;
  --color-sidebar: #161B22;
  --color-sidebar-text: #A9B4BE;
  --color-sidebar-text-active: #FFFFFF;
  --color-sidebar-accent: #3E7C97;
  --color-primary: #1E5F74;
  --color-primary-hover: #164A5B;
  --color-amber: #A8631A;
  --color-amber-bg: #FBF1E3;
  --color-yellow: #A98307;
  --color-yellow-bg: #FBF3D9;
  --color-red: #A6382C;
  --color-red-bg: #FBEBE8;
  --color-green: #2F6B44;
  --color-green-bg: #E9F3EC;
  --color-border: #DDE1E3;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-data: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-ink);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}

.sidebar-brand {
  padding: 0 20px 24px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
  border-bottom: 1px solid #2A313B;
  margin-bottom: 12px;
}

.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: #1F2630; }
.nav-toggle span { display: block; width: 100%; height: 2px; background: #fff; border-radius: 1px; }

.sidebar-brand .unit {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-sidebar-text);
  margin-top: 2px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }

.sidebar nav a {
  color: var(--color-sidebar-text);
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
}

.sidebar nav a:hover { background: #1F2630; text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--color-sidebar-accent); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 20px 0 20px;
  border-top: 1px solid #2A313B;
  font-size: 13px;
}

.sidebar-footer .who { color: #fff; font-weight: 500; }
.sidebar-footer a { color: var(--color-sidebar-text); }

/* Main content */
.main { flex: 1; min-width: 0; padding: 32px 40px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 { margin: 0; font-size: 22px; font-weight: 650; }
.page-header .subtitle { color: var(--color-ink-muted); font-size: 14px; margin-top: 4px; }

.actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: #F7F8F8; text-decoration: none; }

.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.btn-danger { color: var(--color-red); border-color: var(--color-red-bg); background: var(--color-red-bg); }
.btn-danger:hover { background: #F6DAD5; }

.btn-sm { padding: 5px 10px; font-size: 13px; }

/* Cards / panels */
.panel {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.stat-row { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }

.type-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  color: var(--color-ink-muted);
  font-size: 13.5px;
  font-weight: 500;
}
.type-tab:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-ink); }
.type-tab.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.type-tab .count { font-size: 12px; opacity: 0.75; }

.stat-card {
  flex: 1;
  min-width: 160px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-ink-muted);
  border-radius: 6px;
  padding: 16px 18px;
  display: block;
  color: var(--color-ink);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.08s ease;
}
.stat-card:hover { text-decoration: none; color: var(--color-ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.stat-card.selected { box-shadow: 0 0 0 2px var(--color-primary) inset; }

.stat-card .value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-card .label { font-size: 13px; color: var(--color-ink-muted); margin-top: 4px; }

.stat-card.active { border-left-color: var(--color-green); }
.stat-card.due_soon { border-left-color: var(--color-amber); }
.stat-card.overdue { border-left-color: var(--color-red); }
.stat-card.repair_required { border-left-color: var(--color-yellow); }
.stat-card.urgent_repair_required { border-left-color: var(--color-amber); }
.stat-card.out_of_service { border-left-color: var(--color-red); }

/* Tables */
table { width: 100%; border-collapse: collapse; }

.table-scroll { overflow-x: auto; }

/* Keep the row's identifying column in view while scrolling a wide table
   horizontally, so a scrolled-right cell can still be tied back to its row.
   Which column that is varies by table: Parts List / Inventory Audit lead
   with a narrow flag column before the part number (2nd column); Equipment
   leads straight with Unit (1st column). */
.sticky-col-1 th:nth-child(1), .sticky-col-1 td:nth-child(1),
.sticky-col-2 th:nth-child(2), .sticky-col-2 td:nth-child(2) {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-panel);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}
.sticky-col-1 th:nth-child(1), .sticky-col-2 th:nth-child(2) { background: #FAFBFB; z-index: 2; }

.col-toggle {
  display: none; /* only relevant at the <=560px breakpoint that hides .col-optional */
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--color-ink-muted);
  white-space: nowrap;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--color-ink-muted);
  white-space: nowrap;
}

mark { background: #FFE58A; color: inherit; padding: 0 1px; border-radius: 2px; }

.panel table { border-radius: 8px; overflow: hidden; }

th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-ink-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background: #FAFBFB;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr.row-link:hover { background: #F7F9F9; cursor: pointer; }

.mono { font-family: var(--font-data); font-size: 13.5px; color: var(--color-ink-muted); }

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-ink-muted);
}

.sort-link:hover { color: var(--color-ink); text-decoration: none; }

.sort-arrow { font-size: 10px; color: var(--color-primary); }

/* Status badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 9px 3px 7px;
  border-radius: 100px;
}

.status .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.status.active, .status.ok { background: var(--color-green-bg); color: var(--color-green); }
.status.active .dot, .status.ok .dot { background: var(--color-green); }

.status.due_soon { background: var(--color-amber-bg); color: var(--color-amber); }
.status.due_soon .dot { background: var(--color-amber); }

.status.overdue { background: var(--color-red-bg); color: var(--color-red); }
.status.overdue .dot { background: var(--color-red); }

.status.repair_required { background: var(--color-yellow-bg); color: var(--color-yellow); }
.status.repair_required .dot { background: var(--color-yellow); }

.status.urgent_repair_required { background: var(--color-amber-bg); color: var(--color-amber); }
.status.urgent_repair_required .dot { background: var(--color-amber); }

.status.out_of_service { background: var(--color-red-bg); color: var(--color-red); }
.status.out_of_service .dot { background: var(--color-red); }

/* Generic neutral badge -- kept separate from equipment statuses; reused
   e.g. for a non-admin role badge on the Users page. */
.status.neutral { background: #EDEEF4; color: #4A4E7A; }
.status.neutral .dot { background: #4A4E7A; }

/* Dashboard equipment grid -- one tile per unit, colored solid by status
   for an at-a-glance "andon board" read across the whole fleet. */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.equipment-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 92px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.equipment-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); }

.equipment-tile-unit { font-family: var(--font-data); font-size: 17px; font-weight: 700; }
.equipment-tile-name { font-size: 12.5px; opacity: 0.92; }
.equipment-tile-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.95; }

.equipment-tile.status-active { background: var(--color-green); }
.equipment-tile.status-repair_required { background: var(--color-yellow); }
.equipment-tile.status-urgent_repair_required { background: var(--color-amber); }
.equipment-tile.status-out_of_service { background: var(--color-red); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  max-width: 720px;
}

.form-grid .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--color-ink);
}

.field .hint { font-size: 12px; color: var(--color-ink-muted); margin-top: 4px; }

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-panel);
  color: var(--color-ink);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  border-color: var(--color-primary);
}

textarea { resize: vertical; min-height: 70px; }

.form-actions { margin-top: 24px; display: flex; gap: 10px; }

/* Search bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-bar input[type="text"] { max-width: 320px; }
.filter-bar select { max-width: 180px; }

.search-clear-wrap { position: relative; display: inline-flex; }
.search-clear-wrap input[type="text"] { padding-right: 28px; }
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--color-ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.search-clear:hover { color: var(--color-ink); }

/* Inventory Audit -- inline Location / Quantity on hand editing */
.location-edit-wrap { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.location-input, .quantity-input,
.location-mode-select, .location-aisle-select, .location-bank-select,
.location-shelf-select, .location-custom-input {
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 13.5px;
  font-family: var(--font-data);
  color: var(--color-ink);
  background: #fff;
}
.location-input { width: 140px; }
.quantity-input { width: 70px; }
.location-mode-select { width: 108px; }
.location-aisle-select { width: 80px; }
.location-bank-select { width: 70px; }
.location-shelf-select { width: 72px; }
.location-custom-input { width: 140px; }
.location-warehouse-fields { display: inline-flex; gap: 6px; }
.location-input:focus, .quantity-input:focus,
.location-mode-select:focus, .location-aisle-select:focus, .location-bank-select:focus,
.location-shelf-select:focus, .location-custom-input:focus { outline: none; border-color: var(--color-primary); }
.location-save-status { font-size: 13px; width: 14px; flex: 0 0 auto; }
.location-save-status.ok { color: var(--color-green); }
.location-save-status.error { color: var(--color-red); }
.location-save-status.saving { color: var(--color-ink-muted); }

.copyable-cell { display: inline-flex; align-items: center; gap: 6px; }
.copy-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
  color: var(--color-ink-muted);
}
.copy-btn:hover { background: var(--color-bg); color: var(--color-ink); }
.copy-btn.copied { color: var(--color-green); }
.copy-btn.copy-failed { color: var(--color-red); }

/* Flash messages */
.flash { padding: 11px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; }
.flash-success { background: var(--color-green-bg); color: var(--color-green); }
.flash-error { background: var(--color-red-bg); color: var(--color-red); }

/* Empty state */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-ink-muted);
}
.empty-state h3 { color: var(--color-ink); margin-bottom: 6px; }

.import-errors {
  margin: 6px 0 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--color-red);
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-sidebar);
}

.login-card {
  background: var(--color-panel);
  border-radius: 10px;
  padding: 36px 36px 32px 36px;
  width: 100%;
  max-width: 360px;
}

.login-card h1 { font-size: 19px; margin: 0 0 2px 0; }
.login-card .sub { color: var(--color-ink-muted); font-size: 13.5px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }

/* Generic two-column layout (used on its own, e.g. the Users page) */
.detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }

/* Equipment detail page — left nav pane + stacked sections */
.page-nav-grid { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start; }

.page-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px;
}

.page-nav a {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-ink-muted);
}

.page-nav a:hover { background: #F2F4F3; text-decoration: none; color: var(--color-ink); }

.detail-section { scroll-margin-top: 16px; margin-bottom: 36px; }
.detail-section:last-child { margin-bottom: 0; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 24px;
  padding: 20px;
}

.info-grid .full { grid-column: 1 / -1; }

.info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.info-value { font-size: 14.5px; }

.meter-chart-wrap { padding: 18px 20px 8px 20px; border-bottom: 1px solid var(--color-border); }

.meter-chart { width: 100%; height: 90px; display: block; }
.meter-chart polyline { fill: none; stroke: var(--color-primary); stroke-width: 2; }
.meter-chart circle { fill: var(--color-primary); }

.meter-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-ink-muted);
  margin-top: 6px;
}

.custom-fields-panel { padding: 18px; }

.custom-fields-inline { padding: 4px 18px 18px 18px; }

.custom-field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.custom-field-row:last-of-type { border-bottom: none; }

.custom-field-edit-form, .custom-field-add-form {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.custom-field-edit-form input, .custom-field-add-form input,
.custom-field-edit-form select, .custom-field-edit-form textarea { flex: 1; min-width: 140px; }

.custom-field-edit-form textarea { min-height: 38px; }

.qty-input { flex: 0 0 70px !important; min-width: 0 !important; }

.qty-unit-input { flex: 0 0 90px !important; min-width: 0 !important; }

.qty-edit-form { max-width: 320px; }

.custom-field-label {
  flex: 0 0 130px;
  align-self: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
}

.custom-field-add-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-border); }

.custom-field-add-form select { flex: 1; min-width: 160px; }

.field-hint {
  align-self: center;
  font-size: 12.5px;
  color: var(--color-ink-muted);
  white-space: nowrap;
}

.section-title {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 12px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.subsection-title { font-size: 14px; font-weight: 650; margin: 0; }

.section-hint { font-size: 12.5px; color: var(--color-ink-muted); }

/* Link-to-catalog picker */
.link-category-group { padding: 10px 20px; }
.link-category-group + .link-category-group { border-top: 1px solid var(--color-border); }

.link-category-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.link-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
/* An explicit `display` on this class otherwise beats the browser's own
   [hidden] rule (author styles win over UA defaults), so JS setting
   row.hidden = true silently had no visual effect -- force it here. */
.link-item-row[hidden] { display: none; }

.link-item-row .mono { margin-left: 8px; }
.link-item-alts { font-size: 12px; color: var(--color-ink-muted); margin-top: 2px; }
.link-item-alts .mono { margin-left: 0; }

/* Maintenance information — nested accordions */
.acc-category { border-bottom: 1px solid var(--color-border); }
.acc-category:last-child { border-bottom: none; }

.acc-category > summary, .acc-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.acc-category > summary::-webkit-details-marker,
.acc-item > summary::-webkit-details-marker { display: none; }

.acc-category > summary { padding: 14px 18px; }
.acc-item > summary { padding: 10px 14px; }

.acc-summary-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.acc-summary-main::before {
  content: "▸";
  display: inline-block;
  color: var(--color-ink-muted);
  font-size: 11px;
  transition: transform 0.15s ease;
}

details[open] > summary .acc-summary-main::before { transform: rotate(90deg); }

.acc-title { font-weight: 600; }
.acc-meta { color: var(--color-ink-muted); font-size: 13px; }

.acc-category > .acc-body { padding: 0 18px 18px 18px; }
.acc-item > .acc-body { padding: 0 14px 14px 14px; }

.acc-category-actions { display: flex; gap: 8px; padding: 4px 0 14px 0; }

.acc-item {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #FAFBFB;
  margin-bottom: 10px;
}
.acc-item:last-of-type { margin-bottom: 14px; }

.acc-item-notes { font-size: 13.5px; color: var(--color-ink-muted); margin-bottom: 10px; }

.item-location { font-size: 13.5px; color: var(--color-ink-muted); margin-bottom: 10px; }

.alt-section h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-ink-muted);
}

.alt-list { list-style: none; margin: 0 0 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.alt-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-panel);
}

.alt-notes { color: var(--color-ink-muted); font-size: 12.5px; margin-top: 2px; }

.alt-add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alt-add-form input { flex: 1; min-width: 140px; }

.alt-edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.alt-edit-row input { flex: 1; min-width: 140px; }

.flag-checkbox { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; }
.flag-checkbox input { flex: none; width: auto; }

.spec-flag { font-size: 0.85em; }
.parts-flag-col { text-align: center; }

.used-by { font-size: 13.5px; color: var(--color-ink-muted); margin-top: 4px; }
.used-by-units a { margin-right: 2px; }

.acc-item-actions { margin-top: 10px; }

.alt-dialog-close { margin-top: 14px; }

@media (max-width: 880px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 0; border-bottom: 1px solid #2A313B; }
  .detail-grid { grid-template-columns: 1fr; }
  .page-nav-grid { grid-template-columns: 1fr; }
  .page-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .main { padding: 20px; }

  /* Collapsed hamburger nav -- brand bar always shows, links/footer are
     hidden until toggled open (see the inline script in base.html). */
  .nav-toggle { display: flex; }
  .sidebar-brand { padding: 12px 16px; margin-bottom: 0; border-bottom: none; }
  #sidebar-nav, .sidebar-footer { display: none; }
  .sidebar.nav-open #sidebar-nav { display: flex; padding: 4px 12px 12px; }
  .sidebar.nav-open .sidebar-footer {
    display: block;
    padding: 12px 16px 16px;
    margin-top: 4px;
    border-top: 1px solid #2A313B;
  }
}

@media (max-width: 560px) {
  .info-grid { grid-template-columns: 1fr; }

  /* Inventory Audit: on a phone, default to just the columns needed for a
     physical stocktake (part number, type, location, qty on hand) and tuck
     the rest behind a "Show all columns" toggle instead of forcing a long
     horizontal scroll for every row. */
  .col-toggle { display: flex; }
  .table-scroll:not(.show-all-columns) .col-optional { display: none; }
}
