:root {
  --blue: #0d164f;
  --green: #16883f;
  --red: #cf2727;
  --yellow: #d89200;
  --light: #f4f6f8;
  --border: #d7dce1;
  --text: #17212b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--light);
  color: var(--text);
}

a {
  color: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(100%, 500px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 12px 35px rgba(13, 22, 79, .12);
}

.auth-card h1 {
  margin: 0 0 8px;
  color: var(--blue);
}

.auth-card p {
  color: #66717d;
}

label {
  display: block;
  font-weight: 700;
  margin: 16px 0 7px;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 18px;
  border: 0;
  border-radius: 11px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
  width: 100%;
  margin-top: 18px;
}

.btn.secondary {
  background: #eef1f4;
  color: var(--text);
  margin-top: 10px;
}

.btn.small {
  min-height: 38px;
  font-size: 14px;
  margin: 0;
}

.link-btn {
  display: flex;
}

.text-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: var(--blue);
}

.alert {
  padding: 14px;
  border-radius: 10px;
  margin: 15px 0;
  font-weight: 700;
}

.alert.success {
  background: #dff3e6;
  color: var(--green);
}

.alert.error {
  background: #fde1e1;
  color: var(--red);
}

.app-shell,
.admin-shell {
  max-width: 1150px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  padding: 20px;
}

.app-shell {
  max-width: 650px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.app-header h1 {
  margin: 0 0 5px;
}

.app-header p {
  margin: 0;
  color: #66717d;
}

.app-header nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.app-header nav a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.selection-card,
.scan-card,
.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 16px;
}

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

.product-btn {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  font-size: 25px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 18px;
}

.product-btn:hover {
  background: var(--green);
}

.status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: 15px;
  color: #fff;
  text-align: center;
  margin-bottom: 16px;
}

.status strong {
  font-size: 28px;
}

.status time {
  font-size: 20px;
  font-weight: 700;
  margin-top: 5px;
}

.status.ok {
  background: var(--green);
}

.status.error {
  background: var(--red);
}

.status.warn {
  background: var(--yellow);
}

.hidden {
  display: none !important;
}

.step {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #66717d;
}

.code-box {
  background: #f0f2f4;
  padding: 12px;
  border-radius: 10px;
  margin-top: 8px;
  font-family: monospace;
  word-break: break-all;
}

.manual-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.manual-row input {
  flex: 1;
}

.manual-row .btn {
  width: auto;
  margin: 0;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.progress {
  height: 18px;
  background: #e8ecef;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.progress div {
  height: 100%;
  background: var(--green);
  width: 0;
  transition: width .2s;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3f5f7;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.form-grid label {
  margin-top: 0;
}

.form-action .btn {
  margin: 0;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 10px;
}

.filters .btn {
  margin: 0;
  width: auto;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef1f4;
  font-size: 13px;
  font-weight: 700;
}

.badge.match,
.badge.complete {
  background: #dff3e6;
  color: var(--green);
}

.badge.mismatch {
  background: #fde1e1;
  color: var(--red);
}

.badge.incomplete {
  background: #fff2cd;
  color: #8a6500;
}

@media (max-width: 700px) {
  .app-header {
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-btn {
    min-height: 105px;
  }

  .manual-row {
    flex-direction: column;
  }

  .manual-row .btn {
    width: 100%;
  }

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

  .filters .btn {
    width: 100%;
  }

  .auth-card {
    padding: 21px;
  }
}
