:root {
  --gold: #f1b82d;
  --gold-dark: #a46b00;
  --ink: #171717;
  --muted: #67615a;
  --line: #ded7ca;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --green: #557a46;
  --red: #b34638;
  --blue: #356d91;
  --shadow: 0 18px 45px rgba(35, 31, 26, .14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: #b9ad9a;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.button-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.button-link:hover {
  border-color: #b9ad9a;
}

.primary {
  border-color: #171717;
  background: #171717;
  color: #fff;
}

.danger {
  border-color: rgba(179, 70, 56, .35);
  color: var(--red);
}

.app-shell {
  display: grid;
  grid-template-columns: clamp(300px, 22vw, 380px) minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: hidden;
  padding: clamp(16px, 1.6vw, 22px);
  border-right: 1px solid var(--line);
  background: #fffdf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quick-stats span {
  display: block;
  font-size: 25px;
  font-weight: 800;
}

.quick-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.search-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
}

.toolbar,
.modal-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar button {
  flex: 1 1 calc(50% - 4px);
}

.save-status {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.panel {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

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

.section-heading button {
  padding: 0 12px;
}

.location-list {
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  overflow: auto;
  min-height: 0;
  max-height: none;
  padding-right: 4px;
}

.movein-sidebar-panel {
  display: none;
}

.sidebar.movein-sidebar-active .locations-sidebar-panel {
  display: none;
}

.sidebar.movein-sidebar-active .movein-sidebar-panel {
  display: flex;
  flex: 1 1 auto;
}

.sidebar-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.movein-marker-list {
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.location-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.location-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.location-row.active {
  border-color: #171717;
  box-shadow: inset 4px 0 0 var(--gold);
}

.location-row.has-task {
  border-color: rgba(164, 107, 0, .34);
  background: #fffaf0;
}

.location-code {
  position: relative;
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 34px;
  padding: 0 4px;
  place-items: center;
  border-radius: 8px;
  background: #f6ecd4;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-signal,
.marker-task-signal {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #171717;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.task-signal {
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  border: 2px solid #fff;
}

.location-task-preview {
  display: block;
  margin-top: 3px;
  color: #604000;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.location-row strong,
.item-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.location-row strong {
  font-size: 14px;
  line-height: 1.2;
}

.location-row small,
.meta,
.empty-state {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.lock-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.lock-button.locked {
  border-color: rgba(164, 107, 0, .4);
  background: #f6ecd4;
  color: #604000;
}

.location-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-left: 57px;
}

.edit-location-button,
.delete-location-button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 900;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.lock-button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.edit-location-button {
  border-color: rgba(53, 109, 145, .28);
  color: var(--blue);
}

.movein-marker-row {
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 4px 0 0 var(--marker-color, #171717);
}

.movein-marker-row.locked {
  border-color: rgba(164, 107, 0, .34);
  background: #fffaf0;
}

.movein-marker-row.active {
  border-color: #171717;
  background: #f3f8fb;
  box-shadow:
    inset 4px 0 0 var(--marker-color, #171717),
    0 0 0 2px rgba(53, 109, 145, .18);
}

.movein-marker-row-main {
  display: grid;
  grid-template-columns: minmax(58px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.movein-marker-row-code {
  display: grid;
  width: var(--marker-width, 58px);
  min-width: 58px;
  max-width: 92px;
  min-height: 34px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  background: var(--marker-color, #171717);
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.movein-marker-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.movein-marker-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.movein-marker-row p {
  margin-bottom: 0;
  color: #3b352f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.movein-marker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-left: calc(min(var(--marker-width, 58px), 92px) + 9px);
}

.movein-marker-empty {
  padding: 12px;
  border: 1px dashed rgba(103, 97, 90, .45);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.delete-location-button {
  border-color: rgba(179, 70, 56, .35);
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-rows: minmax(640px, 1fr);
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.map-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(241, 184, 45, .18), #efe8db 78px);
}

.map-topbar {
  display: grid;
  grid-template-columns: minmax(190px, .58fr) minmax(220px, 1fr) minmax(0, auto);
  align-items: center;
  gap: 12px;
  padding: 12px 18px 10px;
  box-shadow: inset 0 4px 0 var(--gold);
}

.map-topbar > div:first-child {
  min-width: 0;
}

#mapTitle {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-search {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.map-search input {
  height: 52px;
  border-color: #cfc5b5;
  box-shadow: 0 7px 18px rgba(35, 31, 26, .08);
  font-size: 17px;
}

.map-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  justify-content: end;
  min-width: 0;
}

.map-actions.movein-active .task-widget {
  display: none;
}

.map-actions:not(.movein-active) .movein-widget {
  display: none;
}

.map-action-stack {
  display: grid;
  gap: 6px;
  width: 120px;
}

.map-action-stack button {
  min-height: 39px;
  padding: 0 10px;
  font-weight: 800;
}

.drop-location-button {
  border-color: rgba(164, 107, 0, .42);
  background: #fff8e8;
  color: #4f3600;
  font-weight: 800;
}

.task-widget {
  display: grid;
  gap: 6px;
  width: clamp(270px, 27vw, 390px);
  max-width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: none;
}

.movein-widget {
  display: grid;
  gap: 6px;
  width: clamp(240px, 28vw, 360px);
  max-width: 100%;
  padding: 8px;
  border: 1px solid rgba(53, 109, 145, .28);
  border-radius: 8px;
  background: rgba(243, 248, 251, .9);
}

.task-widget-header,
.movein-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-widget-header strong,
.movein-widget-header strong {
  font-size: 14px;
}

.task-widget-header span,
.movein-widget-header span,
.task-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.movein-widget small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.task-form,
.movein-filter-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(104px, 116px) 46px;
  gap: 6px;
}

.task-form input,
.task-form select,
.movein-filter-grid select {
  height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.task-form button,
.movein-filter-grid button {
  min-height: 32px;
  font-size: 12px;
  font-weight: 900;
}

.movein-filter-grid {
  grid-template-columns: minmax(82px, 1fr) minmax(118px, 1.15fr) 94px;
}

.task-list-open {
  min-height: 30px;
  background: #171717;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.task-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(222, 215, 202, .8);
  border-radius: 8px;
  background: #fff;
}

.task-row label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-width: 0;
}

.task-row input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: #171717;
}

.task-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.25;
}

.task-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.task-row.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.task-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-row-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.task-row-actions button:last-child {
  width: 28px;
  padding: 0;
  color: var(--red);
}

.task-modal-card {
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
}

.backup-modal-card {
  display: grid;
  gap: 12px;
}

.backup-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(47, 125, 79, .22);
  border-radius: 10px;
  background: rgba(47, 125, 79, .08);
  color: #1f4d34;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.backup-json-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

#backupText {
  min-height: 360px;
  max-height: 50vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.backup-file-name {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  word-break: break-all;
}

.full-task-list {
  max-height: 520px;
}

.campus-map {
  flex: 1;
  min-width: 0;
  min-height: 620px;
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: #d9d2c4;
}

.static-map-preview {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 620px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px),
    linear-gradient(135deg, #cbd9c4, #e6dfcf 52%, #c8d5bf);
  background-size: 72px 72px, 72px 72px, cover;
}

.static-campus-label {
  position: absolute;
  left: 29%;
  top: 28%;
  display: grid;
  gap: 3px;
  min-width: 220px;
  padding: 16px;
  border: 2px solid rgba(164, 107, 0, .25);
  border-radius: 8px;
  background: rgba(255, 253, 248, .74);
  box-shadow: 0 12px 28px rgba(20, 18, 16, .12);
}

.static-campus-label strong {
  font-size: 20px;
}

.static-campus-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.static-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 0 0 1px rgba(122, 111, 96, .16);
}

.static-road-west {
  top: -12%;
  left: 13%;
  width: 36px;
  height: 124%;
  transform: rotate(-7deg);
}

.static-road-east {
  top: -8%;
  right: 16%;
  width: 42px;
  height: 116%;
  transform: rotate(4deg);
}

.static-road-main {
  top: 48%;
  left: -8%;
  width: 118%;
  height: 38px;
  transform: rotate(5deg);
}

.static-marker {
  position: absolute;
  display: grid;
  min-width: 46px;
  min-height: 46px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(20, 18, 16, .28);
  transform: translate(-50%, -50%);
}

.campus-map.drop-ready {
  outline: 4px solid rgba(241, 184, 45, .75);
  outline-offset: -4px;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 240px;
  font: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .2) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .2) 1px, transparent 1px),
    linear-gradient(135deg, #cbd9c4, #e6dfcf 52%, #c8d5bf);
  background-size: 72px 72px, 72px 72px, cover;
}

.leaflet-control-layers,
.leaflet-bar {
  border: 1px solid rgba(0, 0, 0, .14) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 20px rgba(20, 18, 16, .14) !important;
  overflow: hidden;
}

.leaflet-control-attribution {
  font-size: 11px;
}

.map-layer-control {
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 24px rgba(20, 18, 16, .16);
}

.map-layer-control strong {
  font-size: 13px;
}

.map-layer-control label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2b251f;
  font-size: 13px;
  font-weight: 800;
}

.map-layer-control input {
  width: 16px;
  height: 16px;
  accent-color: #171717;
}

.inventory-marker {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}

.inventory-marker.active {
  background: var(--gold-dark);
}

.inventory-marker.locked {
  background: #5b564f;
}

.inventory-marker.has-task {
  border-color: var(--gold);
}

.marker-task-signal {
  top: -8px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  border: 2px solid #fff;
}

.cluster-marker {
  width: 42px;
  height: 42px;
  border-color: var(--gold);
  background: #171717;
  box-shadow:
    0 0 0 5px rgba(241, 184, 45, .28),
    0 10px 22px rgba(0, 0, 0, .3);
}

.cluster-marker.locked {
  border-color: #fff;
  background: #5b564f;
  box-shadow:
    0 0 0 5px rgba(91, 86, 79, .22),
    0 10px 22px rgba(0, 0, 0, .3);
}

.movein-marker,
.fallback-movein-marker {
  position: relative;
  display: grid;
  width: var(--marker-width, 44px);
  min-width: var(--marker-width, 44px);
  min-height: 34px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--marker-color, #171717);
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: .04em;
  outline: 4px solid var(--marker-color, #171717);
  outline-offset: 1px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

.movein-marker span,
.fallback-movein-marker span {
  display: block;
  padding: 0 5px;
  white-space: nowrap;
}

.movein-marker.long-label,
.fallback-movein-marker.long-label {
  font-size: 10px;
  letter-spacing: .02em;
}

.movein-marker.active,
.fallback-movein-marker.active {
  box-shadow:
    0 0 0 6px rgba(241, 184, 45, .36),
    0 10px 24px rgba(0, 0, 0, .28);
}

.movein-popup button[data-delete-movein-marker],
.movein-popup button[data-delete-movein-marker]:hover {
  border-color: rgba(179, 70, 56, .35);
  color: var(--red);
}

.movein-verbiage {
  display: block;
  padding: 8px 10px;
  border: 1px solid rgba(23, 23, 23, .12);
  border-radius: 10px;
  background: rgba(241, 184, 45, .14);
  color: #171717;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.marker-label {
  transform: translateY(-4px);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.marker-label span {
  display: block;
  padding: 2px 5px;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: #201c17;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(20, 18, 16, .12);
  white-space: nowrap;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.map-popup {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.map-popup strong {
  font-size: 15px;
}

.map-popup button {
  min-height: 32px;
}

.popup-resource-link,
.detail-resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(53, 109, 145, .28);
  border-radius: 8px;
  background: #f3f8fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.detail-resource-link {
  justify-content: flex-start;
  width: 100%;
}

.cluster-list {
  display: grid;
  gap: 3px;
  max-height: 120px;
  overflow: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.popup-task-list {
  display: grid;
  gap: 3px;
  padding: 6px 7px;
  border-radius: 8px;
  background: #fff8e8;
  color: #604000;
  font-size: 12px;
  font-weight: 800;
}

.map-unavailable {
  display: grid;
  height: 100%;
  min-height: 320px;
  place-items: center;
  padding: 24px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.fallback-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .2) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .2) 1px, transparent 1px),
    linear-gradient(135deg, #cbd9c4, #e6dfcf 52%, #c8d5bf);
  background-size: 72px 72px, 72px 72px, cover;
}

.fallback-map.drop-ready {
  outline: 4px solid rgba(241, 184, 45, .75);
  outline-offset: -4px;
}

.fallback-campus-zone {
  position: absolute;
  left: 28%;
  top: 26%;
  display: grid;
  gap: 2px;
  width: 32%;
  min-width: 180px;
  padding: 16px;
  border: 2px solid rgba(164, 107, 0, .28);
  border-radius: 8px;
  background: rgba(255, 253, 248, .72);
  color: #2b251f;
  box-shadow: 0 12px 28px rgba(20, 18, 16, .12);
}

.fallback-campus-zone strong {
  font-size: 20px;
}

.fallback-campus-zone span,
.fallback-map-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fallback-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 0 0 1px rgba(122, 111, 96, .16);
}

.fallback-road-east {
  top: -8%;
  right: 16%;
  width: 42px;
  height: 116%;
  transform: rotate(4deg);
}

.fallback-road-west {
  top: -12%;
  left: 13%;
  width: 36px;
  height: 124%;
  transform: rotate(-7deg);
}

.fallback-road-north {
  top: 21%;
  left: -6%;
  width: 112%;
  height: 38px;
  transform: rotate(-3deg);
}

.fallback-road-south {
  bottom: 18%;
  left: -8%;
  width: 118%;
  height: 34px;
  transform: rotate(5deg);
}

.fallback-boundary {
  position: absolute;
  inset: 8% 4%;
  border: 2px dashed rgba(164, 107, 0, .7);
  border-radius: 8px;
  background: rgba(241, 184, 45, .08);
  pointer-events: none;
}

.fallback-marker {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 2px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 18, 16, .28);
  transform: translate(-50%, -50%);
}

.fallback-marker.active {
  background: var(--gold-dark);
}

.fallback-marker.locked {
  background: #5b564f;
}

.fallback-marker span {
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.fallback-movein-marker {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
}

.fallback-marker small {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  padding: 3px 6px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: #201c17;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(20, 18, 16, .12);
  transform: translateX(-50%);
}

.fallback-map.hide-labels .fallback-marker small {
  display: none;
}

.fallback-layer-control {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 180px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 24px rgba(20, 18, 16, .16);
}

.fallback-layer-control strong {
  font-size: 13px;
}

.fallback-layer-control label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2b251f;
  font-size: 13px;
  font-weight: 800;
}

.fallback-layer-control input {
  width: 16px;
  height: 16px;
  accent-color: #171717;
}

.fallback-map-note {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 7px 9px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
}

.inventory-pane {
  display: none;
  min-width: 0;
  padding: 20px 22px 28px;
  overflow: auto;
  background: var(--paper);
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.inventory-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border-color: #d8cfbf;
  background: #fff;
  color: #453d34;
  font-size: 13px;
  font-weight: 800;
}

.inventory-status-filter strong {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1eee8;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.inventory-status-filter.active {
  border-color: #171717;
  background: #171717;
  color: #fff;
}

.inventory-status-filter.active strong {
  background: var(--gold);
  color: #171717;
}

.location-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.detail-chip {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-chip span {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.detail-chip small {
  color: var(--muted);
}

.hall-task-panel {
  display: grid;
  gap: 8px;
  background: #fff8e8;
}

.hall-task-panel strong {
  color: #604000;
}

.hall-task-panel label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #332612;
  font-size: 13px;
  font-weight: 800;
}

.hall-task-panel input {
  width: 16px;
  height: 16px;
  accent-color: #171717;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
}

.item-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item-card button {
  display: grid;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.item-photo {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  background: #ece5d8;
  color: var(--muted);
  font-weight: 800;
}

.item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-body {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1eee8;
  color: #453d34;
  font-size: 12px;
  font-weight: 800;
}

.badge.attention,
.badge.missing {
  background: #fae2dd;
  color: var(--red);
}

.badge.available {
  background: #e4eddc;
  color: var(--green);
}

.badge.in-use,
.badge.loaned {
  background: #dceaf2;
  color: var(--blue);
}

dialog {
  width: min(820px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(20, 18, 16, .54);
}

.modal-card {
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wide {
  grid-column: 1 / -1;
}

.file-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.checkbox-field {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: #171717;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.photo-preview img {
  width: 92px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 1120px) {
  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .workspace {
    grid-template-rows: minmax(620px, 1fr);
    height: auto;
    overflow: visible;
  }

  .location-list {
    max-height: 260px;
  }

}

@media (max-width: 1260px) {
  .map-topbar {
    grid-template-columns: minmax(190px, 240px) minmax(280px, 1fr);
    align-items: end;
  }

  .map-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .task-widget {
    width: min(520px, 100%);
    max-width: none;
  }

  .movein-widget {
    width: min(520px, 100%);
    max-width: none;
  }

  .map-action-stack {
    width: 120px;
  }
}

@media (max-width: 1120px) {
  .map-actions {
    align-items: stretch;
  }

  .task-form {
    grid-template-columns: 1fr;
  }

  .movein-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .location-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .location-actions {
    justify-content: flex-end;
    padding-left: 57px;
  }

  .movein-marker-actions {
    padding-left: 0;
  }
}

@media (max-width: 680px) {
  .sidebar,
  .inventory-pane {
    padding: 16px;
  }

  .map-topbar,
  .section-heading,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .map-topbar {
    display: flex;
  }

  .map-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .task-widget {
    width: 100%;
  }

  .movein-widget {
    width: 100%;
  }

  .task-form {
    grid-template-columns: 1fr;
  }

  .location-detail,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}
