@import url('https://fonts.googleapis.com/css2?family=Estedad:wght@100..900&display=swap');

:root {
  color-scheme: dark;
  --bg: #0c0f0e;
  --panel: #151a18;
  --panel-strong: #1c2320;
  --border: #303a35;
  --border-strong: #405049;
  --text: #eef2ef;
  --muted: #9aa7a0;
  --accent: #14b8a6;
  --accent-hover: #0f9488;
  --accent-focus: rgba(20, 184, 166, 0.28);
  --danger-bg: #341313;
  --danger-border: #7f1d1d;
  --danger-text: #fecaca;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Estedad', Arial, Helvetica, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

body > * {
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  min-width: 0;
}

h1,
h2 {
  width: min(100%, 920px);
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  text-align: center;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.2;
}

h2 + table {
  margin-bottom: 28px;
}

form,
.menu,
.results {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

form {
  width: min(100%, 560px);
  padding: 28px;
}

#addProduct {
  width: min(100%, 560px);
}

#addProduct form {
  width: 100%;
}

.menu {
  width: min(100%, 560px);
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.menu a {
  flex: 1 1 190px;
}

.page-actions {
  width: min(100%, 560px);
  margin-bottom: 16px;
}

a,
button {
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  color: #06201c;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button {
  display: inline-block;
  margin-top: 14px;
}

a:hover,
button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--accent-focus);
  outline-offset: 2px;
}

.results {
  width: min(100%, 980px);
  margin-top: 24px;
  padding: 24px;
  overflow-x: auto;
}

.results p {
  margin: 0;
  color: var(--muted);
}

.error {
  width: min(100%, 560px);
  margin: 16px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  color: var(--danger-text);
  background: var(--danger-bg);
  font-weight: 800;
}

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

thead {
  background: var(--panel-strong);
}

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

th {
  color: var(--text);
  font-weight: 900;
}

td {
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

label {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-weight: 800;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  background: #0f1412;
}

input::placeholder,
textarea::placeholder {
  color: #6f7b75;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.item {
  min-width: 0;
}

.row label {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.row input {
  height: 50px;
}

@media (max-width: 560px) {
  body {
    padding: 28px 12px;
  }

  h1 {
    margin-bottom: 18px;
    font-size: 30px;
  }

  h2 {
    font-size: 18px;
  }

  form,
  .menu,
  .results {
    width: 100%;
    padding: 18px;
  }

  #addProduct,
  .page-actions,
  .error {
    width: 100%;
  }

  .menu {
    flex-direction: column;
  }

  .menu a {
    flex-basis: auto;
    width: 100%;
  }

  .page-actions a,
  button {
    width: 100%;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .row label {
    min-height: auto;
    justify-content: flex-start;
    text-align: left;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .results {
    margin-top: 18px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

@media (max-width: 380px) {
  body {
    padding-inline: 8px;
  }

  form,
  .menu,
  .results {
    padding: 14px;
  }

  a,
  button {
    padding-inline: 14px;
  }
}
