:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #697386;
  --line: #e4e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --shadow: 0 20px 50px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
}

.app {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.app-header {
  margin-bottom: 24px;
}

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

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
}

.description {
  color: var(--muted);
  line-height: 1.7;
}

.card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.form {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 14px;
  align-items: end;
}

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

label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

label span {
  color: var(--muted);
  font-weight: 600;
}

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.primary-button {
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

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

.message {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  font-size: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
}

td {
  font-size: 15px;
  font-weight: 650;
}

.delete-button {
  padding: 8px 12px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.06);
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.empty {
  display: none;
  margin: 12px 0 0;
  color: var(--muted);
}

.empty.is-visible {
  display: block;
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 24px, 920px);
    padding: 24px 0;
  }

  .card {
    padding: 18px;
    border-radius: 18px;
  }

  .form {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}
