:root {
  --bg: #070707;
  --panel: #0d0d0d;
  --line: #1f1f1f;
  --text: #f2f2f2;
  --muted: #a7a7a7;
  --accent: #f0c94b;
  --accent-2: #d8b23c;
  --ok: #8ef5a8;
  --danger: #ff7b8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Sora", sans-serif;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
  display: grid;
  gap: 1rem;
}

.brand {
  margin: 0;
  color: #f6d777;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
}

.subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

h2 {
  margin: 0;
  font-size: 1rem;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.total {
  font-family: "Manrope", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #f6f6f6;
}

.client-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.84rem;
  color: #dbdbdb;
}

input[type="text"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #101010;
  color: #ededed;
  padding: 0.58rem 0.65rem;
  font-family: "Sora", sans-serif;
}

input:focus {
  outline: none;
}

.paste-zone {
  border: 1px solid #1c1c1c;
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
  background: #0a0a0a;
  cursor: pointer;
}

.paste-zone p {
  margin: 0;
  font-size: 0.9rem;
}

.paste-zone small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
}

kbd {
  background: #222;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
}

.preview-wrap {
  display: grid;
  gap: 0.45rem;
}

.preview-wrap img {
  width: min(420px, 100%);
  height: 96px;
  object-fit: contain;
  background: #0a0a0a;
  border-radius: 10px;
}

.hidden {
  display: none;
}

.danger-btn {
  width: fit-content;
  border: none;
  border-radius: 8px;
  background: #2c1b1b;
  color: #ffdbe2;
  padding: 0.38rem 0.62rem;
  font-family: "Sora", sans-serif;
  font-size: 0.76rem;
  cursor: pointer;
}

.search-block {
  position: relative;
}

.search-input {
  width: 100%;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 5;
}

.result-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #eee;
  padding: 0.56rem 0.68rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: "Sora", sans-serif;
}

.result-item:hover {
  background: #1b1b1b;
}

.result-meta {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 0.06rem;
}

.result-price {
  color: #8ef5a8;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.selected-items {
  display: grid;
  gap: 0.52rem;
}

.selected-empty {
  margin: 0;
  padding: 0.68rem;
  border-radius: 10px;
  color: var(--muted);
  background: #0f0f0f;
}

.selected-row {
  display: grid;
  grid-template-columns: 1.7fr auto 84px auto;
  align-items: center;
  gap: 0.52rem;
  padding: 0.54rem 0.6rem;
  border-radius: 10px;
  background: #121212;
}

.selected-price {
  color: #8ef5a8;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.qty-input {
  text-align: center;
}

.row-remove {
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  background: #2c1b1b;
  color: #ffdbe2;
  font-family: "Sora", sans-serif;
  font-size: 0.76rem;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #1c1c1c;
  font-weight: 700;
  font-family: "Sora", sans-serif;
  padding: 0.66rem 0.8rem;
  cursor: pointer;
}

.submit-btn:disabled {
  filter: saturate(0.5);
}

.status {
  margin: 0;
  min-height: 1.05rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

@media (max-width: 860px) {
  .client-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .selected-row {
    grid-template-columns: 1fr auto 74px;
  }

  .row-remove {
    grid-column: 1 / -1;
    justify-self: end;
  }
}
