:root {
  --green: #2D9D5B;
  --green-dark: #237A46;
  --red: #C13C41;
  --yellow: #FAE160;
  --white: #ffffff;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --line: #e6e6e6;
  --page: #fafafa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  background: var(--green);
  border-bottom: 6px solid var(--yellow);
  color: var(--white);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: 220px;
  background: var(--white);
  border: 2px solid var(--yellow);
  border-radius: 4px;
  padding: 2px;
}

.brand-text { display: flex; flex-direction: column; }
.company {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.product {
  font-size: 0.85rem;
  opacity: 0.95;
}

.logout-form button {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--yellow);
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font: inherit;
}
.logout-form button:hover { background: var(--green-dark); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

h1, h2 {
  color: var(--red);
  margin: 0 0 0.5rem;
}

.lede { margin: 0 0 1rem; color: var(--muted); }

.card {
  background: var(--white);
  border: 2px solid var(--yellow);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 26rem;
}

.login-form, .search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.login-form {
  flex-direction: column;
  align-items: stretch;
}

label { font-weight: 600; }

input[type="password"],
input[type="search"],
input[type="text"] {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  width: 100%;
}
input[type="search"] { min-width: 16rem; flex: 1; }
input:focus {
  outline: 3px solid var(--yellow);
  border-color: var(--green);
}

.btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--green-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--green-dark);
  border: 2px solid var(--green);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.9rem 0 0.4rem;
}

.catalog-meta {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 4px;
  margin: 0 0 1rem;
}
.flash-error {
  background: #fdecee;
  color: var(--red);
  border: 1px solid #f0b6b9;
}
.flash-ok {
  background: #e8f7ee;
  color: var(--green-dark);
  border: 1px solid var(--green);
}

.search-panel { margin-bottom: 1.25rem; }

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 2px solid var(--yellow);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

th {
  background: var(--green);
  color: var(--white);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: #f7fbf8; }
tbody tr:hover { background: #fff8d4; }

.common { display: block; font-weight: 600; }
.botanical { display: block; font-style: italic; color: var(--muted); font-size: 0.9rem; }
.category, .sku { display: block; color: var(--muted); font-size: 0.8rem; }
.size { display: block; font-weight: 600; }

.avail { margin: 0; padding: 0; list-style: none; }
.avail li { white-space: nowrap; }
.neg { color: var(--red); }

.source-link {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
}
.source-link:hover { color: var(--red); }

.source-note {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
}


.empty { color: var(--muted); }

@media (max-width: 800px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr {
    padding: 0.6rem 0;
    border-bottom: 2px solid var(--yellow);
  }
  td {
    border: 0;
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.4rem;
    padding: 0.25rem 0.8rem;
  }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--red);
  }
  .logo { height: 48px; }
}
