:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #65727d;
  --line: #dfe6ea;
  --green: #0f7a55;
  --yellow: #ab6a00;
  --red: #b02a37;
  --blue: #135c8a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.scan-body {
  overflow: hidden;
}

.scan-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px;
  background: #101820;
}

.scan-card {
  width: min(1100px, 100%);
  min-height: 680px;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: #f8fafb;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
}

.station-label {
  color: var(--green);
  font-size: 30px;
  font-weight: 800;
}

.scan-card h1 {
  margin: 0;
  font-size: clamp(54px, 8vw, 96px);
  line-height: 1.05;
}

.scan-card p {
  margin: 0;
  color: var(--muted);
  font-size: 28px;
}

.scan-input {
  width: 100%;
  height: 120px;
  border: 4px solid #b8c9d0;
  border-radius: 10px;
  padding: 0 34px;
  font-size: clamp(42px, 7vw, 74px);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.scan-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 8px rgba(15, 122, 85, 0.14);
}

.feedback {
  min-height: 120px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 22px 28px;
  font-size: 34px;
  font-weight: 800;
  border: 3px solid transparent;
}

.feedback span {
  display: block;
  font-size: 24px;
  font-weight: 600;
}

.feedback.idle {
  background: #edf2f4;
  color: #51616c;
  border-color: #d6e0e5;
}

.feedback.success {
  background: #e1f4ea;
  color: #08603f;
  border-color: #0f7a55;
}

.feedback.duplicate {
  background: #fff3cf;
  color: #8b5200;
  border-color: #d58a00;
}

.feedback.invalid,
.feedback.error,
.alert.danger {
  background: #fde8e8;
  color: var(--red);
  border-color: #e9a3a9;
}

.scan-help {
  color: var(--muted);
  font-size: 22px;
}

.center-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card p,
.small-note {
  color: var(--muted);
}

.auth-card label,
.filters label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #34424d;
}

.auth-card input,
.filters input,
.filters select,
.void-form input {
  min-height: 40px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.primary,
.button,
.admin-topbar button,
.void-form button {
  min-height: 40px;
  border: 1px solid #0a6345;
  border-radius: 8px;
  padding: 8px 13px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button {
  background: #ffffff;
  color: #18333a;
  border-color: #c5d4d8;
}

.admin-topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  background: #101820;
  color: #ffffff;
}

.admin-topbar div,
.admin-topbar form {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-topbar span {
  color: #cbd6dc;
}

.admin-topbar button {
  min-height: 34px;
  background: #ffffff;
  color: #101820;
  border-color: #ffffff;
}

.admin-nav {
  display: flex;
  gap: 8px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.admin-nav a {
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #43515a;
}

.admin-nav a.active {
  background: #e6f3ef;
  color: var(--green);
  font-weight: 800;
}

.admin-main {
  width: min(1380px, calc(100vw - 32px));
  margin: 18px auto 46px;
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-head h1 {
  margin: 0;
  font-size: 24px;
}

.panel-head span {
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto auto auto;
  gap: 12px;
  align-items: end;
}

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

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

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: #f7fafb;
  color: #475762;
}

.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f4f1;
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.badge.warn {
  background: #fff3cf;
  color: var(--yellow);
}

.badge.danger {
  background: #fde8e8;
  color: var(--red);
}

.void-row {
  color: #8b969e;
  background: #fafafa;
}

.void-form {
  display: flex;
  gap: 8px;
}

.inline-form {
  display: inline-flex;
}

.void-form input {
  width: 160px;
}

.void-form button,
.inline-form button {
  min-height: 34px;
  background: #ffffff;
}

.void-form button {
  color: var(--red);
  border-color: #e5a1a8;
}

.inline-form button {
  border: 1px solid #b8cbd0;
  border-radius: 8px;
  padding: 6px 10px;
  color: #213942;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 980px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .scan-screen {
    padding: 14px;
  }

  .scan-card {
    min-height: calc(100vh - 28px);
    padding: 28px;
  }

  .scan-card h1 {
    font-size: 52px;
  }

  .scan-card p {
    font-size: 22px;
  }

  .scan-input {
    height: 96px;
    font-size: 40px;
  }

  .feedback {
    font-size: 28px;
  }

  .admin-topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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