:root {
  color-scheme: dark;
  --ink: #05070d;
  --night: #09111f;
  --panel: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.1);
  --mist: #d7e3ff;
  --steel: #8fa4c7;
  --green: #a7f3d0;
  --red: #fecaca;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(154, 180, 255, 0.16), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(84, 129, 255, 0.14), transparent 32%),
    var(--ink);
  color: var(--mist);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

.app {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 14px;
}

.shell,
.login {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(9, 17, 31, 0.95);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.login {
  margin-top: 10vh;
}

.header,
.panel,
.login-inner {
  padding: 18px;
}

.header {
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: rgba(143, 164, 199, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 12px;
  font-size: 21px;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.muted {
  color: var(--steel);
  font-size: 14px;
  line-height: 1.65;
}

.sync-status {
  margin: 6px 0 0;
  font-size: 12px;
}

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

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

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.42);
}

.tab,
.segmented button,
.btn {
  min-height: 44px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
}

.tab {
  background: transparent;
  color: var(--steel);
}

.tab.active,
.segmented button.active,
.btn.primary {
  background: var(--mist);
  color: var(--ink);
}

.btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.075);
  color: white;
}

.btn.ghost {
  border: 1px solid var(--line);
}

.btn.green {
  background: var(--green);
  color: #052014;
}

.btn.danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
}

.btn:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

label {
  display: block;
  color: var(--steel);
  font-size: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: white;
  outline: none;
  padding: 13px 14px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(215, 227, 255, 0.75);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 15px;
}

.message {
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
}

.message.ok {
  border: 1px solid rgba(167, 243, 208, 0.25);
  background: rgba(16, 185, 129, 0.12);
  color: #d1fae5;
}

.message.err {
  border: 1px solid rgba(254, 202, 202, 0.22);
  background: rgba(239, 68, 68, 0.12);
  color: #fee2e2;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5, 7, 13, 0.45);
  padding: 5px;
}

.segmented button {
  background: transparent;
  color: var(--steel);
}

.scanner {
  display: grid;
  gap: 10px;
}

video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: black;
  object-fit: cover;
}

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qty {
  color: white;
  font-size: 28px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 10px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.stepper {
  display: grid;
  grid-template-columns: 44px 54px 44px;
  gap: 6px;
  align-items: center;
}

.stepper button,
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
  color: white;
  font-weight: 800;
}

.stepper input {
  margin: 0;
  padding: 10px 4px;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  .grid-md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-md {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
  }

  .btn.fit {
    width: auto;
    min-width: 150px;
  }
}
