* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  background: #f4f6fb;
  color: #111827;
}

.topbar {
  background: #0b1220;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar .sub {
  color: #9ca3af;
}

.topbar a {
  color: #93c5fd;
  text-decoration: none;
  margin-left: 8px;
}

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 52px);
}

.sidebar {
  background: #111827;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.sidebar a.active,
.sidebar a:hover {
  background: #1e293b;
  color: #fff;
}

.main {
  padding: 20px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  margin-top: 10px;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 9px;
  text-align: left;
}

input,
select,
button {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

button {
  background: #0f172a;
  color: #fff;
  border: none;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.danger {
  background: #b91c1c;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  background: #334155;
  color: #fff;
}

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

.barcode-form {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
}

.scanner-video {
  width: 100%;
  max-width: 480px;
  margin-top: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: none;
  background: #000;
}

label {
  display: block;
  margin-bottom: 6px;
}

.value {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 0;
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  display: grid;
  gap: 10px;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

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