.inventory-main { padding: 30px 0 120px; }
.inventory-kicker { margin: 0 0 4px !important; color: var(--brand) !important; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.inventory-hero {
  display: flex; align-items: end; justify-content: space-between; gap: 30px;
  margin-bottom: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 27px;
  background: linear-gradient(135deg, #f8faf7 0%, #edf5ef 100%);
}
.inventory-hero h2 { max-width: 760px; margin: 17px 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.03; letter-spacing: -.045em; }
.inventory-hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.hero-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.inventory-metrics { margin-bottom: 18px; }
.inventory-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.inventory-primary { min-width: 0; }
.inventory-panel { margin: 0 0 18px; }
.sticky-panel { position: sticky; top: 18px; }
.panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading-row h2, .inventory-panel > h2 { margin: 5px 0 0; }
.panel-eyebrow { color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .11em; }
.panel-copy { margin: -7px 0 18px; color: var(--muted); line-height: 1.55; }
.compact-select { min-height: 40px; max-width: 240px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.filter-grid { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(170px, .8fr) minmax(170px, .8fr) auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.filter-button { min-height: 47px; }
.sow-list { display: grid; gap: 10px; }
.sow-row {
  display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) minmax(170px, 1fr) auto;
  gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff;
}
.sow-code { font-size: 16px; font-weight: 850; }
.sow-identifiers, .sow-location { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-badge { display: inline-flex; width: fit-content; padding: 6px 9px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-size: 11px; font-weight: 850; }
.status-badge.warning { background: #fff3d9; color: #865b08; }
.status-badge.info { background: #e9f0ff; color: #244e91; }
.status-badge.treatment { background: #f6e9e7; color: #8c2d27; }
.sow-actions { display: flex; justify-content: flex-end; gap: 7px; }
.icon-button { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 12px; font-weight: 800; }
.icon-button:hover { background: var(--soft); }
.location-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.location-card { min-height: 118px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.location-card.occupied { border-color: rgba(36,91,61,.28); background: #f2f8f3; }
.location-card.free { border-style: dashed; }
.location-card strong { display: block; font-size: 13px; }
.location-card span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.location-card .occupancy-dot { width: 8px; height: 8px; margin: 0 0 9px; border-radius: 50%; background: var(--success); }
.location-card.free .occupancy-dot { background: #b7c3b8; }
.location-card button { width: 100%; min-height: 30px; margin-top: 10px; border: 0; border-radius: 9px; background: var(--soft); color: var(--brand-dark); font-size: 11px; font-weight: 850; }
.quality-grid { display: grid; gap: 9px; margin-top: 18px; }
.quality-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.quality-grid span { color: var(--muted); font-size: 13px; }
.quality-grid strong { font-size: 21px; }
.inventory-rule { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--soft); }
.inventory-rule strong { font-size: 13px; }
.inventory-rule p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.inventory-bottom-nav { grid-template-columns: repeat(5, 1fr); }
.inventory-bottom-nav button { min-height: 54px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.inventory-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 25px; background: transparent; }
.inventory-dialog::backdrop { background: rgba(20,32,25,.58); backdrop-filter: blur(5px); }
.dialog-card { max-height: calc(100vh - 30px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); box-shadow: var(--shadow); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-header h2 { margin: 5px 0 0; font-size: 25px; }
.dialog-close { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 25px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.scanner-card { width: 100%; }
.scanner-window { position: relative; min-height: 300px; display: grid; place-items: center; overflow: hidden; border-radius: 20px; background: #142019; color: rgba(255,255,255,.72); }
.scanner-window video { width: 100%; min-height: 300px; object-fit: cover; }
.scanner-window span { position: absolute; bottom: 20px; width: calc(100% - 38px); text-align: center; font-size: 13px; }
.scanner-frame { position: absolute; width: min(270px, 74%); aspect-ratio: 1.5; border: 2px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.22); }
.scanner-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.scanner-input label { font-size: 12px; }
.scan-result { margin-top: 14px; }
.scan-result-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.scan-result-card strong { font-size: 18px; }
.scan-result-card p { margin: 7px 0 0; color: var(--muted); }
.label-card { width: 100%; }
.label-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 14px; }
.label-grid figure { min-height: 250px; display: grid; place-items: center; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.label-grid figcaption { width: 100%; color: var(--muted); font-size: 12px; font-weight: 800; }
.label-grid img { max-width: 100%; max-height: 210px; }

@media (max-width: 980px) {
  .inventory-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .location-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .inventory-main { padding-top: 18px; }
  .inventory-hero { align-items: stretch; flex-direction: column; padding: 22px; }
  .hero-quick-actions { justify-content: stretch; }
  .hero-quick-actions .button { flex: 1; }
  .sow-row { grid-template-columns: 1fr 1fr; }
  .sow-actions { grid-column: 1 / -1; justify-content: stretch; }
  .sow-actions button { flex: 1; }
  .location-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scanner-actions { grid-template-columns: 1fr; }
  .label-grid { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
}

@media (max-width: 480px) {
  .inventory-hero h2 { font-size: 32px; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-grid .field:first-child { grid-column: auto; }
  .sow-row { grid-template-columns: 1fr; }
  .sow-actions { grid-column: auto; }
  .location-map { grid-template-columns: 1fr 1fr; }
  .inventory-bottom-nav a, .inventory-bottom-nav button { font-size: 10px; }
}


/* v0.2.0-dev.2 · Movements and maternity map */
.icon-button.primary, .cage-actions button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.scan-flow-banner { margin: 14px 0 18px; padding: 13px 15px; border: 1px solid rgba(64,137,92,.28); border-radius: 15px; background: #edf8f1; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #245e3a; font-size: 13px; }
.location-card { cursor: default; }
.location-card > span { min-height: 34px; }
.cage-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.cage-actions button { flex: 1; min-width: 62px; min-height: 31px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 10px; font-weight: 800; }
.movement-list { display: grid; gap: 9px; }
.movement-row { display: grid; grid-template-columns: .8fr 1.2fr 1fr; gap: 14px; align-items: center; padding: 14px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.movement-row > div { display: grid; gap: 4px; min-width: 0; }
.movement-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.movement-row span, .movement-row > div:last-child { color: var(--muted); font-size: 11px; }
.movement-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.movement-summary > div { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
.movement-summary span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.movement-summary strong { font-size: 18px; }
.field textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: #fff; color: var(--ink); font: inherit; }
.scan-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }

@media (max-width: 720px) {
  .movement-row { grid-template-columns: 1fr; }
  .movement-summary { grid-template-columns: 1fr; }
  .scan-flow-banner { align-items: flex-start; flex-direction: column; }
  .scan-result-actions .button { flex: 1; }
}
