* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0b1120;
  color: #e5e7eb;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.app-header {
  padding: 1.5rem 1rem;
  text-align: center;
  background: radial-gradient(circle at top, #1d4ed8, #020617);
  border-bottom: 1px solid #1f2937;
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

.app-main {
  max-width: 960px;
  width: 100%;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.material-form {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr auto;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-size: 0.85rem;
  color: #9ca3af;
}

input[type="text"],
input[type="number"] {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #111827;
  color: #e5e7eb;
  transition: background 0.15s ease, transform 0.05s ease,
    box-shadow 0.1s ease;
}

.btn.primary {
  background: linear-gradient(to right, #3b82f6, #22c55e);
  color: #0b1120;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

.btn.small {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.btn.danger {
  background: linear-gradient(to right, #ef4444, #f97316);
  color: #0b1120;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

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

.list-actions {
  display: flex;
  gap: 0.5rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}

.search-row {
  margin-bottom: 0.75rem;
}

.search-row input {
  width: 100%;
}

.material-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #111827;
}

.material-item.completed {
  opacity: 0.6;
}

.material-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.material-name {
  font-size: 0.95rem;
}

.material-amount {
  font-size: 0.8rem;
  color: #9ca3af;
}

.material-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.complete-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.tag.done {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.tag.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.list-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .material-form {
    grid-template-columns: 1fr;
  }

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

  .list-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
