:root {
  --orange: #f97316;
  --ink: #171717;
  --muted: #666;
  --bg: #f7f6f3;
  --line: #ddd9d3;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.45 Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 11px 12px;
  font-size: 16px;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}
.lookup {
  position: relative;
}
.lookup > small {
  color: var(--muted);
  font-weight: 600;
}
.suggestions {
  position: absolute;
  z-index: 15;
  top: calc(100% - 20px);
  left: 0;
  right: 0;
  max-height: min(360px, 48vh);
  overflow-y: auto;
  border: 1px solid #cfc8bf;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 16px 40px #0003;
  padding: 6px;
}
.suggestions button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid #eee;
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
  text-align: left;
}
.suggestions button:last-child {
  border-bottom: 0;
}
.suggestions button:hover,
.suggestions button:focus {
  background: #fff3eb;
  outline: 2px solid var(--orange);
}
.suggestions strong,
.suggestions span,
.suggestions small {
  display: block;
}
.suggestions span,
.suggestions small {
  color: var(--muted);
  font-weight: 600;
}
.no-suggestion {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-weight: 600;
}
.primary,
.outline,
.quiet {
  min-height: 46px;
  border-radius: 9px;
  padding: 11px 16px;
  font-weight: 850;
}
.primary {
  border: 0;
  background: var(--orange);
}
.outline,
.quiet {
  background: #fff;
  border: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 6px;
  color: #777;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.brand {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.4px;
}
.brand small {
  display: block;
  color: #aaa;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.auth-card {
  width: min(430px, calc(100% - 28px));
  margin: 8vh auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 24px 60px #0001;
}
.auth-card h1 {
  font-size: 34px;
  margin: 6px 0;
}
.auth-card form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.error {
  color: #9b1c1c;
  font-weight: 750;
  min-height: 20px;
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #111;
  color: #fff;
  padding: 24px 17px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #bbb;
  text-align: left;
  padding: 13px;
  font-weight: 800;
}
nav button.active {
  background: #2b2b2b;
  color: #fff;
  border-left: 3px solid var(--orange);
}
.account {
  margin-top: auto;
  border-top: 1px solid #333;
  padding-top: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.account > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--orange);
  color: #111;
  font-weight: 950;
}
.account small {
  display: block;
  color: #aaa;
}
.workspace {
  min-width: 0;
}
header {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}
header span {
  color: #777;
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 28px;
}
.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.heading h1 {
  margin: 0;
  font-size: 35px;
  line-height: 1.08;
  letter-spacing: -1.2px;
}
.heading p {
  margin: 7px 0 0;
  color: var(--muted);
}
.hero {
  background: #111;
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.hero h2 {
  font-size: 28px;
  margin: 4px 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.metric,
.panel,
.unit-card,
.part-card,
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.metric {
  padding: 15px;
}
.metric strong {
  display: block;
  font-size: 27px;
}
.metric small {
  color: var(--muted);
}
.panel,
.form-card {
  padding: 18px;
  margin-bottom: 16px;
}
.toolbar {
  display: grid;
  grid-template-columns: 1fr 200px auto;
  gap: 10px;
  margin-bottom: 14px;
}
.chips {
  display: flex;
  gap: 7px;
  overflow: auto;
  margin-bottom: 14px;
}
.chip {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}
.chip.active {
  background: #111;
  color: #fff;
}
.unit-list,
.part-list {
  display: grid;
  gap: 9px;
}
.unit-card,
.part-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}
.unit-card:hover,
.part-card:hover {
  border-color: var(--orange);
}
.code {
  display: block;
  color: #c2410c;
  font-weight: 950;
}
.unit-card small,
.part-card small {
  display: block;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eee;
  font-size: 11px;
  font-weight: 900;
}
.badge.office,
.badge.parts,
.badge.new {
  background: #fff1e7;
  color: #9a3412;
}
.badge.ready,
.badge.received,
.badge.installed {
  background: #dcfce7;
  color: #166534;
}
.badge.released {
  background: #e5e7eb;
}
.badge.repair,
.badge.transit,
.badge.ordered {
  background: #222;
  color: #fff;
}
.privacy {
  display: flex;
  gap: 9px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  padding: 13px;
  margin-bottom: 16px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.full {
  grid-column: 1/-1;
}
.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  padding: 10px;
  font-weight: 850;
}
.choice.selected {
  background: #111;
  color: #fff;
}
.product-card {
  border: 2px solid #e4e1dc;
}
.product-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.product-head h3 {
  margin: 0;
}
.remove {
  border: 0;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 850;
}
.camera {
  position: relative;
  border: 2px dashed #d3cec7;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: #faf9f7;
}
.camera input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
}
.camera label {
  cursor: pointer;
  font-size: 14px;
}
.camera small {
  display: block;
  color: var(--muted);
}
.optional {
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
}
.previews {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.previews img,
.photos img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
}
.add-product {
  width: 100%;
  min-height: 68px;
  border: 2px dashed var(--orange);
  background: #fff7ed;
  border-radius: 12px;
  font-weight: 900;
  margin-bottom: 100px;
}
.sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px;
  box-shadow: 0 -8px 22px #0001;
}
.sticky small {
  color: var(--muted);
}
dialog {
  width: min(650px, calc(100% - 24px));
  max-height: 92vh;
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 28px 80px #0005;
}
dialog::backdrop {
  background: #0009;
}
.close {
  position: sticky;
  top: 10px;
  float: right;
  margin: 10px;
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: #111;
  color: #fff;
  font-size: 20px;
}
.drawer-content {
  padding: 26px;
}
.drawer-content h2 {
  font-size: 30px;
  margin: 4px 0;
}
.current-location {
  background: #111;
  color: #fff;
  border-radius: 12px;
  padding: 15px;
  margin: 16px 0;
}
.current-location small,
.current-location strong {
  display: block;
}
.current-location strong {
  font-size: 21px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.detail-grid > div {
  background: #f7f6f3;
  border-radius: 9px;
  padding: 10px;
}
.detail-grid small,
.detail-grid strong {
  display: block;
}
.wide {
  grid-column: 1/-1;
}
.history {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.event {
  border-left: 3px solid var(--orange);
  padding-left: 11px;
}
.event small {
  display: block;
  color: var(--muted);
}
.edit-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
}
.edit-box .fields {
  margin-top: 10px;
}
.photos {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#pinDialog form {
  padding: 24px;
}
#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  background: #111;
  color: #fff;
  border-radius: 9px;
  padding: 12px 16px;
}
#toast:empty {
  display: none;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 34px;
}
.owner-private {
  background: #171717;
  color: #fff;
  border-radius: 10px;
  padding: 12px;
}
.owner-private small {
  color: #bbb;
}
.loading {
  padding: 40px;
  text-align: center;
  color: #777;
}
@media (max-width: 800px) {
  .shell {
    display: block;
    padding-bottom: 68px;
  }
  aside {
    position: fixed;
    z-index: 20;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 66px;
    padding: 7px;
    background: #111;
    display: block;
  }
  .brand,
  .account {
    display: none;
  }
  nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }
  nav button {
    text-align: center;
    padding: 8px 2px;
    font-size: 11px;
    min-height: 50px;
  }
  nav button.active {
    border-left: 0;
    border-top: 3px solid var(--orange);
  }
  header {
    height: 55px;
    padding: 0 13px;
  }
  header span {
    display: none;
  }
  main {
    padding: 18px 12px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .heading h1 {
    font-size: 29px;
  }
  .heading .primary {
    width: 100%;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    grid-template-columns: 1fr;
  }
  .unit-card,
  .part-card {
    grid-template-columns: 1fr auto;
  }
  .unit-card > :nth-child(2),
  .part-card > :nth-child(2) {
    grid-column: 1/-1;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .full,
  .wide {
    grid-column: auto;
  }
  .choice-row {
    grid-template-columns: 1fr 1fr;
  }
  .sticky {
    bottom: 66px;
    align-items: stretch;
    flex-direction: column;
  }
  .sticky button {
    width: 100%;
  }
  .add-product {
    margin-bottom: 115px;
  }
  .drawer-content {
    padding: 22px 16px;
  }
  .dialog-actions {
    grid-template-columns: 1fr;
  }
  #toast {
    bottom: 82px;
    left: 12px;
    right: 12px;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.print-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.report-metrics {
  grid-template-columns: repeat(6, 1fr);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.report-grid .panel {
  margin: 0;
}
.report-grid ol {
  padding-left: 20px;
}
.report-grid li {
  margin: 9px 0;
}
.report-grid li b {
  float: right;
}
@media (max-width: 800px) {
  .report-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .print-actions {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 380px) {
  .choice-row,
  .detail-grid,
  .print-actions {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}
