@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --ink: #000000;
  --paper: #ffffff;
  --bg: #f2f2f2;
  --shadow: rgba(0, 0, 0, 0);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
}

.appBar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.appBarInner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 900;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-size: 18px;
}

.topBackLink {
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 6px 10px;
  font-weight: 700;
  background: var(--paper);
}

.appHint {
  font-size: 12px;
  font-weight: 700;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

.filterBar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}


.pageTitle {
  margin: 0;
  font-weight: 1000;
  letter-spacing: -0.03em;
  font-size: 1em;
}

.pageSubtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.9;
}

.emptyState {
  padding: 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-weight: 800;
}

.grid {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 12px;
  grid-auto-flow: dense;
  align-items: stretch;
}

.card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: none;
  border-radius: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.cardRowSpan1 {
  grid-row: span 14;
}

.cardRowSpan2 {
  grid-row: span 28;
}

.cardImage {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--ink);
  margin-bottom: 10px;
}

.cardLink {
  display: block;
  padding: 14px;
  text-decoration: none;
  color: inherit;
}

.cardLink:hover {
  background: var(--paper);
}

.cardTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.uidBlock {
  display: flex;
  flex-direction: row;
  gap: 2px;
}

.uidLabel {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
}

.uidValue {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.uidMissing {
  opacity: 0.6;
}

.idLine {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.badge {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  font-weight: 1000;
  border-radius: 0;
  font-size: 12px;
  line-height: 1;
}

.cardBody {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.cardMain {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deviceName {
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.deviceMeta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metaPill {
  border: 2px solid var(--ink);
  padding: 6px 10px;
  background: transparent;
  border-radius: 0;
  font-weight: 900;
  font-size: 12px;
}

.pillAlt {
  background: transparent;
}

.cardFacts {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
}

.fact {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: start;
}

.factKey {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
}

.factVal {
  font-size: 13px;
  font-weight: 500;
  word-break: break-word;
}

.linkChip {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--ink);
  font-weight: 1000;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 0;
  margin-right: 8px;
  margin-bottom: 8px;
}

.cardActions {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.linkChip--blue {
  background: transparent;
}

.linkChip--green {
  background: transparent;
}

.cardDisabled {
  padding: 14px;
  opacity: 1;
}

.backLink {
  font-weight: 1000;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--ink);
  display: inline-block;
  padding: 10px 12px;
  border-radius: 0;
  background: var(--paper);
}

.detailGrid {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.itemHeader {
  display: flex;
  flex-direction: row;
  font-size: 28px;
  align-items: flex-end;
  gap: 8px;
}

.itemHeader .pageHeader {
  flex: 1;
  min-width: 0;
}

.itemHeader {
  font-size: 2.5em;
}

.itemHeader .uidBadge {
  margin-bottom: 0.4em;
}

.uidBadge {
  flex-shrink: 0;
  display: inline-block;
  font-weight: 1000;
  font-size: 0.65em;
  font-family: monospace;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--paper);
  background: var(--ink);
  padding: 2px 4px;
  border-radius: 0;
  white-space: nowrap;
}

.detailNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.itemLayout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.imagePanel {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  order: -1;
}

.imagePreview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.imagePreviewWrap {
  position: relative;
}

.imageEditToggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  opacity: 0;
  transition: opacity 120ms ease;
  cursor: pointer;
}

.imagePanelHasImage:hover .imageEditToggle,
.imagePanelHasImage:focus-within .imageEditToggle,
.imagePanelEditing .imageEditToggle {
  opacity: 1;
}

.imagePlaceholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--ink);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.imagePlaceholderTitle {
  font-weight: 700;
}

.imagePlaceholderText {
  font-size: 13px;
}

.imageActions {
  display: grid;
  gap: 8px;
}

.imageActionsHidden {
  display: none;
}

.imageForm {
  margin: 0;
}

.imageFileLabel {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  cursor: pointer;
}

.imageFileInput {
  display: none;
}

.imageUrlForm {
  display: grid;
  gap: 8px;
}

.imageUrlInput {
  width: 100%;
  border: 2px solid var(--ink);
  padding: 8px 10px;
  font: inherit;
  background: var(--paper);
}

.imageUrlButton {
  width: 100%;
  cursor: pointer;
}

.imageMessage {
  margin: 0;
  border: 2px dashed var(--ink);
  padding: 8px 10px;
  font-size: 13px;
}

.imageMessageError {
  background: #ffffff;
}

.imageMessageSuccess {
  background: #ffffff;
}

.stickerPanel {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 8px;
}

.stickerTitle {
  font-size: 12px;
  font-weight: 700;
}

.stickerPreview {
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: block;
}

.stickerDownload {
  justify-self: start;
  display: inline-flex;
}

.stickerVariant {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.25);
}

.stickerVariant:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.relocatePanel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.relocateFormHidden {
  display: none;
}

.relocateForm {
  display: grid;
  gap: 10px;
}

.relocateSearchLabel {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.locationResults {
  display: grid;
  gap: 6px;
}

.locationResult {
  display: grid;
  grid-template-columns: 40px auto 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 2px dashed var(--ink);
  background: var(--paper);
  padding: 8px;
  cursor: pointer;
  font: inherit;
}

.locationResult:hover {
  background: #000;
  color: #fff;
}

.locationResultThumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--ink);
  display: block;
}

.locationResultThumbEmpty {
  background: #eee;
}

.locationResultName {
  font-weight: 700;
  min-width: 0;
  word-break: break-word;
}

.locationResultTag {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
  padding: 2px 6px;
}

.relocateSelected {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.relocateActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relocateHint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.qrScannerWrap {
  display: grid;
  gap: 8px;
}

.qrVideo {
  width: 100%;
  max-height: 260px;
  background: #000;
  border: 2px solid var(--ink);
  object-fit: cover;
}

.containedSection {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.containedTitle {
  margin: 0;
  font-size: 16px;
  font-weight: 1000;
}

.containedGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.containedCard {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--ink);
  padding: 8px;
  background: var(--paper);
}

.containedCard:hover {
  background: #000;
  color: #fff;
}

.containedThumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--ink);
  display: block;
}

.containedThumbEmpty {
  background: #eee;
}

.containedMeta {
  font-size: 1.2em;
}

.containedName {
  font-weight: 700;
  word-break: break-word;
}

.detailCard {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 16px;
  box-shadow: none;
}

.detailTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.detailTitle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detailDevice {
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.detailBrand {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.srNr {
  min-width: 220px;
  border: 2px solid var(--ink);
  background: transparent;
  padding: 10px 12px;
  border-radius: 0;
}

.srLabel {
  font-size: 11px;
  font-weight: 1000;
  opacity: 0.8;
}

.srValue {
  font-weight: 1000;
  word-break: break-word;
  margin-top: 4px;
}

.facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.factRow {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: start;
}

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

  .imageFormDesktopOnly {
    display: none;
  }

  .imagePanelHasImage .imageEditToggle {
    opacity: 1;
  }
}

@media (min-width: 721px) {
  .itemLayout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }

  .imagePanel {
    order: 2;
    position: sticky;
    top: 72px;
  }

  .detailGrid {
    margin-top: 0;
  }

  .imageFormMobileOnly {
    display: none;
  }
}

.facts dt {
  font-weight: 1000;
  opacity: 0.8;
  font-size: 12px;
}

.facts dd {
  margin: 0;
  font-weight: 850;
  word-break: break-word;
}

.linksBlock {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
}

.linksTitle {
  font-weight: 1000;
  margin-bottom: 10px;
  font-size: 12px;
  opacity: 0.85;
}

.links {
  display: flex;
  flex-wrap: wrap;
}

.buttonLink {
  border-style: dashed;
  text-decoration: none;
}

.buttonLink:hover {
  background: #000000;
  color: #ffffff;
}

.buttonLinkActive {
  background: #000000;
  color: #ffffff;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 0;
}

.sheetMessage {
  margin-top: 14px;
}

.sheetForm {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.sheetToolbar {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.sheetRange,
.sheetActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.sheetRangeField {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.sheetInput {
  border: 2px solid var(--ink);
  padding: 8px 10px;
  font: inherit;
  background: var(--paper);
  min-width: 120px;
}

.sheetCounter {
  font-size: 13px;
  font-weight: 700;
  align-self: center;
}

.sheetList {
  display: grid;
  gap: 8px;
}

.sheetRow {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.sheetCheckbox {
  width: 16px;
  height: 16px;
}

.sheetName {
  font-weight: 700;
  min-width: 0;
  word-break: break-word;
}

.sheetMeta {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

@media (max-width: 720px) {
  .sheetRow {
    grid-template-columns: auto auto 1fr;
  }

  .sheetMeta {
    grid-column: 3;
  }
}

.adminGrid {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.adminCard {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.adminCardTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 1000;
}

.adminCardText {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.adminImportForm {
  display: grid;
  gap: 8px;
}

.previewTableWrap {
  margin-top: 16px;
  overflow: auto;
  border: 2px solid var(--ink);
  background: var(--paper);
  max-height: 60vh;
}

.previewTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.previewTable th,
.previewTable td {
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.previewTable th {
  position: sticky;
  top: 0;
  background: #eee;
  font-weight: 800;
}

.previewActions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fabAdd {
  display: none;
}

.addItemForm {
  margin-top: 12px;
  display: grid;
  gap: 16px;
}

.addStep {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.addStepTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 1000;
}

.addStepText {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.addStepActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.addPhotoPreviewWrap {
  border: 2px solid var(--ink);
  background: #eee;
  aspect-ratio: 1 / 1;
  max-width: 280px;
  overflow: hidden;
}

.addPhotoPreview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.addField {
  display: grid;
  gap: 6px;
}

.addFieldLabel {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.addFieldHint {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.addTextarea {
  resize: vertical;
  min-height: 64px;
}

.addMetaPanel {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
}

@media (max-width: 720px) {
  .fabAdd {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    width: 56px;
    height: 56px;
    border: 2px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 0 0 0 transparent;
  }

  .fabAdd:active {
    background: var(--paper);
    color: var(--ink);
  }

  .container {
    padding-bottom: 88px;
  }
}

