:root {
  --bg: #0b1220;
  --surface: #111827;
  --card: #151f32;
  --border: #243045;
  --text: #e8eefc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #0f766e 0%, transparent 45%), var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.header {
  padding: max(1rem, env(safe-area-inset-top)) 1rem 0.5rem;
}

.header__inner {
  max-width: 560px;
  margin: 0 auto;
}

.header__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  letter-spacing: -0.02em;
}

.header__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.card--accent {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(160deg, #152238 0%, #121c2e 100%);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.card__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.card__head .card__title {
  margin: 0;
}

.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  background: var(--border);
  color: var(--text);
  border-radius: 999px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.input--textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.input--file {
  padding: 0.55rem;
  font-size: 0.9rem;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.field--bulk {
  margin-bottom: 0.25rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.form__sub {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 48px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #0b1220;
}

.btn--primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:active:not(:disabled) {
  background: var(--surface);
}

.btn--small {
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

.btn--danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.4);
}

.btn--block {
  width: 100%;
}

.muted {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty {
  margin: 0;
  padding: 1rem 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.65rem;
  padding: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: start;
}

.product__thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--border);
}

.product__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.product__mini-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.product .input {
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
}

.product .input--textarea {
  min-height: 3.25rem;
  resize: vertical;
}

.product__price-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.product__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.product__actions .btn {
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  flex: 1 1 auto;
}

.footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(120%);
  background: #1e293b;
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  max-width: min(92vw, 420px);
  text-align: center;
  transition: transform 0.25s ease;
  z-index: 50;
}

.toast--show {
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 480px) {
  .product {
    grid-template-columns: 88px 1fr;
  }

  .product__thumb {
    width: 88px;
    height: 88px;
  }

  .product__actions .btn {
    flex: 0 1 auto;
  }
}
