:root {
  --bg: #07111f;
  --bg-2: #0b1728;
  --panel: #111c2e;
  --panel-2: #17263d;
  --panel-3: #21324d;
  --text: #f8fafc;
  --muted: #aab7ca;
  --line: #33445f;
  --line-strong: #4b6385;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #facc15;
  --orange: #f97316;
  --teal: #0f766e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #07111f 0%, #0d1a2d 55%, #08111f 100%);
  color: var(--text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

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

button {
  border: 1px solid transparent;
  cursor: pointer;
}

button:active { transform: translateY(1px); }

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 90px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0b1424;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.session-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.session-strip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-strip button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #111827;
  border-color: var(--line-strong);
  color: #fff;
  font-weight: 900;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(100%, 430px);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 4px;
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0f766e;
  border: 1px solid #2dd4bf;
  font-weight: 900;
  letter-spacing: 0;
}

.mark-img {
  object-fit: contain;
  background: #fff;
  padding: 4px;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  color: #fff;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.app-version {
  color: #dbeafe;
  font-weight: 800;
  white-space: nowrap;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-toggle button,
.bottom-nav button {
  min-height: 46px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  border-color: var(--line);
  color: #dbeafe;
  font-weight: 850;
  font-size: 14px;
}

.mode-toggle button.active,
.bottom-nav button.active {
  color: #fff;
  background: var(--blue);
  border-color: #60a5fa;
}

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px;
}

.hero {
  border-bottom: 1px solid var(--line);
  background: #0f1d32;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 12px;
}

.hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
}

.hero p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.field-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #07111f;
  color: #fff;
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #7f8ea3;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .28);
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.order-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.item-name {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.2;
  color: #fff;
}

.description {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.queue {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.menu-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.material-picker {
  display: grid;
  grid-template-columns: 1fr 92px auto;
  gap: 8px;
  align-items: end;
}

.material-picker .add-btn {
  min-width: 88px;
}

.material-qty input {
  text-align: center;
  font-weight: 900;
}

.item-card {
  display: block;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.selectable-row {
  cursor: pointer;
}

.selectable-row:active {
  transform: translateY(1px);
}

.item-art {
  display: none;
}

.item-main {
  min-width: 0;
  display: contents;
}

.item-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #0b1424;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.item-head .item-name {
  margin-bottom: 0;
}

.status.READY {
  width: 100%;
  justify-content: flex-start;
  border-color: #22c55e;
  background: rgba(22, 163, 74, .16);
  color: #bbf7d0;
}

.status.PENDING {
  border-color: #facc15;
  color: #fef08a;
}

.status.SENT,
.status.COMPLETE,
.status.COMPLETED {
  border-color: #22c55e;
  color: #bbf7d0;
}

.add-btn,
.primary-btn,
.secondary-btn,
.icon-btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 13px;
  font-weight: 900;
}

.add-btn {
  align-self: center;
  color: #fff;
  background: var(--green);
  border-color: #4ade80;
}

.primary-btn {
  width: 100%;
  margin-top: 10px;
  color: #fff;
  background: var(--green);
  border-color: #4ade80;
}

.secondary-btn {
  width: 100%;
  color: #e5eefc;
  background: var(--panel-3);
  border-color: var(--line-strong);
  text-align: left;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line:first-of-type {
  border-top: 1px solid var(--line);
}

.empty {
  padding: 20px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #0b1424;
  color: var(--muted);
  text-align: center;
}

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #0b1424;
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, .35);
}

.cart-bar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.cart-bar-inner.two {
  grid-template-columns: repeat(2, 1fr);
}

.cart-bar-inner.three {
  grid-template-columns: repeat(3, 1fr);
}

.bottom-nav button {
  width: 100%;
  text-align: center;
}

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

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 86px;
  z-index: 40;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  display: none;
}

.toast.show {
  display: block;
}

@media (max-width: 420px) {
  .brand-title { font-size: 16px; }
  .hero h1 { font-size: 25px; }
  .mode-toggle button,
  .bottom-nav button {
    font-size: 13px;
    padding: 8px 6px;
  }

  .material-picker {
    grid-template-columns: 1fr;
  }

  .material-picker .add-btn {
    width: 100%;
  }
}

@media (min-width: 740px) {
  .topbar-inner {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 12px 16px;
  }

  .mode-toggle {
    width: 300px;
  }

  .content,
  .hero-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .field-grid.two {
    grid-template-columns: 1fr 220px;
  }

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