:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d9dee8;
  --primary: #166534;
  --primary-dark: #14532d;
  --danger: #b91c1c;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #0f172a;
  color: white;
}

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

.app-header p {
  margin: 0;
  color: #cbd5e1;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1500px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.wide { grid-column: 1 / -1; }

h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  font-size: .92rem;
}

label {
  display: block;
  font-weight: 700;
  margin: .7rem 0;
}

input, textarea {
  width: 100%;
  padding: .65rem;
  margin-top: .25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}

textarea { resize: vertical; }

.checkbox {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-weight: 400;
}

.checkbox input { width: auto; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.actions, .section-title {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 10px;
  padding: .65rem .9rem;
  cursor: pointer;
  font-weight: 700;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

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

button.danger {
  background: white;
  color: var(--danger);
  border-color: #fecaca;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: .65rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-size: .88rem;
}

.star {
  font-size: 1.2rem;
  color: #ca8a04;
  cursor: pointer;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .75rem;
}

.price-card, .list-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem;
  background: #fff;
}

.price {
  font-size: 1.35rem;
  font-weight: 800;
}

.sale {
  color: var(--primary);
  font-weight: 800;
}

.list {
  display: grid;
  gap: .6rem;
}

pre {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 12px;
  overflow: auto;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #0f172a;
  color: white;
  padding: .8rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }

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