* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6d7890;
  --line: #dfe5ef;
  --primary: #1167d8;
  --primary-dark: #0c4fa9;
  --danger: #c93838;
  --shadow: 0 18px 50px rgba(28, 45, 75, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #edf5ff 0%, var(--bg) 45%, #f9fbfd 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1100px, calc(100% - 32px));
  margin: 42px auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero > div:first-child,
.price-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(223, 229, 239, 0.85);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero > div:first-child {
  padding: 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.subtitle,
#countText {
  color: var(--muted);
  margin-bottom: 0;
}

.price-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.price-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.price-card div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.price-card strong {
  white-space: nowrap;
  color: var(--primary);
}

.panel {
  padding: 28px;
  margin-bottom: 24px;
}

.order-form {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr auto;
  gap: 16px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: 0.2s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(17, 103, 216, 0.12);
}

button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  height: 48px;
  padding: 0 22px;
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.list-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary {
  padding: 11px 15px;
  background: #eef4fb;
  color: var(--primary-dark);
}

.secondary:hover {
  background: #e3edf9;
}

.secondary.danger {
  color: var(--danger);
  background: #fff0f0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f7f9fc;
  font-size: 0.85rem;
  color: #56627a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tfoot td {
  background: #f7f9fc;
  font-weight: 800;
  border-top: 2px solid var(--line);
  border-bottom: 0;
}

.remove-btn {
  background: transparent;
  color: var(--danger);
  padding: 7px 10px;
  font-size: 0.9rem;
}

.empty-row td {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 820px) {
  .hero,
  .order-form {
    grid-template-columns: 1fr;
  }

  .list-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  .actions button {
    width: 100%;
  }
}
