:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #1d252c;
  --muted: #66717c;
  --line: #d9e0e5;
  --accent: #0e7c86;
  --accent-2: #f0b429;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

a { color: inherit; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  background: #1f2a33;
  color: #fff;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 24px auto 64px;
}

.hero-panel,
.panel,
.auth-card,
.detail-head {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(31, 42, 51, .05);
}

.auth-card {
  max-width: 520px;
  margin: 50px auto;
}

h1, h2 {
  margin: 0 0 14px;
  line-height: 1.15;
}

h1 { font-size: 30px; }
h2 { font-size: 20px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .08em;
}

.form,
.grid-form,
.filter-grid,
.search-row,
.inline-form {
  display: grid;
  gap: 12px;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.grid-form,
.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 10px 15px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.btn.secondary {
  background: #e8eef2;
  color: var(--ink);
}

.btn.small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 13px;
}

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

.notice {
  border-radius: 6px;
  padding: 11px 12px;
  background: #e8f6f3;
  color: #125548;
}

.notice.error {
  background: #fdebea;
  color: var(--danger);
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

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

.qty-box {
  min-width: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  text-align: center;
}

.qty-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.qty-box strong {
  font-size: 36px;
}

.two-col,
.location-graphic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
}

.photo {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.location-line {
  font-weight: 800;
}

.container-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(54px, 1fr));
  gap: 8px;
}

.drawer-cell,
.position-cell {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f5;
  font-weight: 800;
  text-align: center;
}

.drawer-cell.active,
.position-cell.active {
  border-color: #8a6500;
  background: var(--accent-2);
  color: #171200;
}

.position-stack {
  display: grid;
  gap: 7px;
}

.position-cell {
  min-height: 38px;
  grid-template-columns: 1fr auto;
  padding: 0 12px;
}

.position-cell small {
  color: var(--muted);
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-tile {
  min-height: 84px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  text-decoration: none;
  font-weight: 800;
}

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

.label-sheet {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.label-card {
  width: 360px;
  min-height: 150px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid #111;
  color: #111;
}

.label-card img {
  width: 110px;
  height: 110px;
}

.label-card strong,
.label-card span,
.label-card small {
  display: block;
}

@media (max-width: 720px) {
  .topbar,
  .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .search-row,
  .two-col,
  .location-graphic {
    grid-template-columns: 1fr;
  }
}

@media print {
  body { background: #fff; }
  .topbar, .btn { display: none; }
  .shell { margin: 0; width: auto; }
}
