@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");

* {
  box-sizing: border-box;
}

:root {
  --bg: #eef1f5;
  --bg-soft: #e2e7ee;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --primary: #1f7a5c;
  --primary-strong: #14573f;
  --primary-soft: #e7f6ec;
  --border: #e4e7ec;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(1000px 500px at 10% -10%, #dde8f6 0, transparent 55%),
    radial-gradient(900px 500px at 90% 0%, #ddeee5 0, transparent 55%),
    var(--bg);
  color: var(--ink);
}

a {
  color: var(--primary);
}

a:hover {
  color: #b5f1d7;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav a {
  margin-right: 12px;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav a:hover {
  text-decoration: none;
  background: var(--bg-soft);
  color: var(--primary-strong);
}

.logout {
  margin-left: auto;
}

.container {
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 16px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-actions {
  display: flex;
  gap: 8px;
}

.page-header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.card.narrow {
  max-width: 420px;
  margin: 60px auto;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two .card {
  margin-bottom: 0;
}

.label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.value {
  font-size: 20px;
  font-weight: 700;
}

.muted {
  font-size: 12px;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0f2f7;
}

tbody tr:hover {
  background: #f8fafc;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #ffffff;
  color: var(--ink);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #a5d6bf;
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.15);
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
.button {
  display: inline-block;
  border: none;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
.button:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid #cde8dc;
  box-shadow: none;
}

.button.ghost:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.button.danger {
  background: #d9534f;
  box-shadow: var(--shadow-soft);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag-stock {
  background: #fff4ce;
  border: 1px solid #ffe08a;
  color: #7a5200;
}

.tag-product {
  background: #e7f6ec;
  border: 1px solid #bfe7c8;
  color: #1c6b3b;
}

.tag-free {
  background: #e7f6ec;
  border: 1px solid #bfe7c8;
  color: #1c6b3b;
}

.tag-reserved {
  background: #fff4ce;
  border: 1px solid #ffe08a;
  color: #7a5200;
}

.tag-sold {
  background: #e6f0ff;
  border: 1px solid #b8d3ff;
  color: #1b4b9b;
}

.tag-used {
  background: #ffe7d6;
  border: 1px solid #ffc79e;
  color: #7a3a00;
}

.tag-bad {
  background: #fff4f4;
  border: 1px solid #ffd4d4;
  color: #9b1b1b;
}

.tag-info {
  background: #e7f6ec;
  border: 1px solid #bfe7c8;
  color: #1c6b3b;
}

.tag-warning {
  background: #fff4ce;
  border: 1px solid #ffe08a;
  color: #7a5200;
}

.tag-error {
  background: #fff4f4;
  border: 1px solid #ffd4d4;
  color: #9b1b1b;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.filter label {
  margin-bottom: 0;
  min-width: 200px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.code-cell {
  word-break: break-all;
}

.stack {
  margin-top: 10px;
}

.alert {
  background: #fff4f4;
  border: 1px solid #ffd4d4;
  color: #9b1b1b;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.notice {
  background: #edf9f1;
  border: 1px solid #cfe9d8;
  color: #14663d;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.helper {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

@media (max-width: 720px) {
  .grid.two,
  .grid.three,
  .grid.four,
  .grid.stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .logout {
    margin-left: 0;
  }
}
