:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #17211f;
  --muted: #5d6b67;
  --line: #d8e0dd;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  --shadow: 0 18px 60px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.panel {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.search-form,
.admin-form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 14px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 124px;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  outline: none;
}

#cargoCode {
  text-transform: uppercase;
}

input[type="file"] {
  padding: 12px 14px;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status {
  min-height: 24px;
  color: var(--muted);
  font-size: 15px;
}

.status.error {
  color: var(--danger);
}

.result {
  display: grid;
  gap: 14px;
}

.result-header {
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  font-weight: 800;
}

.barcode,
.position,
.summary-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.barcode {
  background: #fff;
}

.barcode-svg {
  width: 100%;
  height: 76px;
  fill: #111827;
}

.barcode-text {
  text-align: center;
  color: var(--text);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.field span {
  color: var(--muted);
  font-size: 14px;
}

.field strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

@media (max-width: 560px) {
  .shell {
    padding: 0;
  }

  .panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 24px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .field {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
