:root {
  --ink: #15201d;
  --muted: #65736f;
  --paper: #f3f0e8;
  --panel: #fffdfa;
  --panel-2: #f8f6ef;
  --line: #ded8cb;
  --line-strong: #c9bfae;
  --leaf: #176b52;
  --leaf-dark: #0f493a;
  --teal: #0f7c80;
  --gold: #b87918;
  --rust: #a94a2f;
  --danger: #b4362b;
  --ok: #176b52;
  --shadow: 0 22px 70px rgba(21, 32, 29, 0.13);
  --soft-shadow: 0 10px 30px rgba(21, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", "Aptos", "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(21, 32, 29, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(21, 32, 29, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #f5f1e7 0%, #eef4f0 44%, #f7efe6 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

button,
.button-link {
  min-height: 42px;
  border: 1px solid rgba(15, 73, 58, 0.18);
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(180deg, var(--leaf), var(--leaf-dark));
  box-shadow: 0 9px 18px rgba(23, 107, 82, 0.18);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

button:hover,
.button-link:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

button:active,
.button-link:active {
  transform: translateY(0);
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 124, 128, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #53625d;
  background: #f4f1e9;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td small {
  color: var(--muted);
}

a {
  color: var(--leaf-dark);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.public-page {
  display: grid;
  place-items: center;
  padding: 48px 28px;
  color: #fff;
  background: #191d38;
}

.verify-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 28px;
  width: min(1040px, 100%);
  align-items: stretch;
}

.brand-panel {
  position: relative;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  border: 1px solid rgba(253, 185, 26, 0.18);
  border-radius: 22px;
  padding: 48px 54px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.brand-hero {
  position: relative;
  z-index: 1;
}

.public-logo {
  width: min(174px, 58vw);
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  color: #fdb91a;
  text-decoration: none;
}

.public-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.brand-panel h1 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(40px, 4.8vw, 58px);
  line-height: 1.22;
  letter-spacing: -0.04em;
}

.brand-panel .eyebrow,
.brand-panel .lede {
  color: rgba(255, 255, 255, 0.72);
}

.lede {
  margin: 16px 0 0;
  color: var(--muted);
  max-width: 480px;
  font-size: 17px;
  line-height: 1.55;
}

.verify-card,
.form-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: var(--shadow);
}

.verify-card {
  align-self: stretch;
  display: grid;
  align-content: center;
  border-color: rgba(253, 185, 26, 0.18);
  border-radius: 22px;
  padding: 28px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.verify-card-head {
  margin-bottom: 20px;
}

.verify-card-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.verify-card-head p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.66);
}

.verify-card form,
.form-card {
  display: grid;
  gap: 15px;
}

.verify-card input[name="code"],
#code {
  height: 58px;
  border-color: rgba(253, 185, 26, 0.38);
  color: #fff;
  background: rgba(8, 10, 24, 0.62);
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.public-page .verify-card label {
  color: rgba(255, 255, 255, 0.72);
}

.public-page input {
  min-height: 52px;
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  background: rgba(8, 10, 24, 0.5);
}

.public-page input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.public-page input:focus {
  border-color: #fdb91a;
  box-shadow: none;
}

.public-page button {
  min-height: 56px;
  border: none;
  border-radius: 14px;
  color: #191d38;
  background: #fdb91a;
  box-shadow: none;
}

.result {
  margin-top: 18px;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  color: #111522;
  background: rgba(255, 255, 255, 0.92);
}

.result strong {
  display: block;
  margin-bottom: 6px;
  font-size: 22px;
}

.result.success {
  border-color: rgba(23, 107, 82, 0.38);
  background: rgba(23, 107, 82, 0.09);
}

.result.warning {
  border-color: rgba(184, 121, 24, 0.38);
  background: rgba(184, 121, 24, 0.11);
}

.result.error {
  border-color: rgba(180, 54, 43, 0.35);
  background: rgba(180, 54, 43, 0.09);
}

.result-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 13px;
  color: #191d38;
  background: #fdb91a;
  text-decoration: none;
}

.support-note {
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 700;
}

.support-note a {
  color: #fdb91a;
}

.admin-page {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 24px 18px;
  color: #fff;
  background:
    linear-gradient(180deg, #10231e 0%, #15201d 56%, #2a2118 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 16px);
}

.brand-lockup {
  display: grid;
  gap: 6px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  color: #16231f;
  background: linear-gradient(135deg, #f0c878, #f7f0dc);
  font-size: 24px;
  font-weight: 900;
}

.sidebar h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1;
}

.sidebar nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.sidebar button,
.nav-link {
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  color: #e7eee9;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  border: 1px solid transparent;
}

.sidebar button.active,
.sidebar button:hover,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.15);
  transform: none;
}

.admin-main {
  min-width: 0;
  padding: 30px;
}

.login-panel {
  display: grid;
  min-height: calc(100vh - 60px);
  place-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1;
}

.top-actions,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notice {
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--leaf-dark);
  border: 1px solid rgba(23, 107, 82, 0.28);
  background: rgba(23, 107, 82, 0.08);
}

.notice.error {
  color: var(--danger);
  border-color: rgba(180, 54, 43, 0.32);
  background: rgba(180, 54, 43, 0.09);
}

.notice.warning {
  color: #76500f;
  border-color: rgba(184, 121, 24, 0.34);
  background: rgba(184, 121, 24, 0.11);
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 18px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-head h3,
.workband h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
}

.workband {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  background:
    linear-gradient(100deg, rgba(255,253,250,0.96), rgba(245,239,224,0.92)),
    repeating-linear-gradient(90deg, rgba(21,32,29,0.05) 0 1px, transparent 1px 18px);
  box-shadow: var(--soft-shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.stat {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: var(--soft-shadow);
}

.slim-form {
  background: #f9f5ec;
}

.span-2 {
  grid-column: span 2;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.empty {
  padding: 22px;
  color: var(--muted);
  font-weight: 800;
}

.badge {
  display: inline-flex;
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  color: var(--leaf-dark);
  background: rgba(23, 107, 82, 0.11);
}

.badge.verified {
  color: #7a4f11;
  background: rgba(184, 121, 24, 0.16);
}

.badge.blocked {
  color: var(--danger);
  background: rgba(180, 54, 43, 0.12);
}

.compact {
  max-width: 480px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.risk-grid h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.labels-page {
  padding: 28px;
}

.labels-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.labels-toolbar h1 {
  margin: 0;
}

.labels-toolbar p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.label-card {
  min-height: 252px;
  display: grid;
  align-content: start;
  gap: 6px;
  break-inside: avoid;
  border: 1px dashed #6e7773;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.label-card .label-brand {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.label-card strong {
  font-size: 28px;
  line-height: 1;
}

.label-card img {
  width: 96px;
  height: 96px;
  justify-self: center;
  object-fit: contain;
}

.label-card span {
  font-weight: 800;
}

.label-card small {
  color: var(--muted);
}

.label-card p:last-child {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: #45514d;
  font-size: 11px;
}

@media print {
  body {
    background: #fff;
  }

  .labels-toolbar,
  .notice {
    display: none !important;
  }

  .labels-page {
    padding: 0;
  }

  .label-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .label-card {
    box-shadow: none;
    page-break-inside: avoid;
  }
}

@media (max-width: 960px) {
  .brand-panel h1 {
    font-size: 46px;
    line-height: 1.2;
  }

  .verify-shell,
  .admin-page {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .public-page,
  .admin-main {
    padding: 16px;
  }

  .brand-panel {
    min-height: auto;
    padding: 28px;
  }

  .brand-panel h1 {
    font-size: 36px;
    line-height: 1.2;
  }

  .public-logo {
    width: 154px;
    margin-bottom: 24px;
  }

  .lede {
    font-size: 16px;
  }

  .sidebar nav,
  .stats-grid,
  .form-grid,
  .risk-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .topbar,
  .toolbar,
  .workband {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 32px;
  }
}
