/* Styles moved from public/index.html */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: #f7f4ef;
  min-height: 100vh;
  color: #2a2218;
}

.hero {
  background: #1e2a1a;
  padding: 2.8rem 2rem 2rem;
  text-align: center;
  border-bottom: 3px solid #5a8a3c;
  position: relative;
}
.hero-logo {
  position: absolute;
  left: 100px;
  top: 50%;
  transform: translateY(-50%);
  height: 160px;
  width: auto;
  mix-blend-mode: screen;
}
.hero-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #8fc96e; margin-bottom: 0.75rem; font-weight: 500; }
.hero h1 { font-size: 42px; font-weight: 600; color: #f0ede5; line-height: 1.1; margin-bottom: 0.6rem; }
.hero h1 em { font-style: italic; color: #8fc96e; }
.hero p { font-size: 15px; color: #a8b8a0; max-width: 480px; margin: 0 auto; line-height: 1.6; }

.stats-bar {
  background: #283821; padding: 0.75rem 2rem;
  display: flex; justify-content: center; gap: 2.5rem;
  border-bottom: 1px solid #3a5228;
}
.stat { text-align: center; }
.stat-num { font-size: 18px; font-weight: 500; color: #8fc96e; }
.stat-label { font-size: 11px; color: #6a8a60; text-transform: uppercase; letter-spacing: 0.1em; }

.main { max-width: 1400px; margin: 0 auto; padding: 2.5rem 1.5rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.5rem; align-items: center; }
.search-wrap { flex: 0 0 100%; position: relative; }
.search-wrap input {
  width: 100%; padding: 10px 16px 10px 40px;
  border: 0.5px solid #ccc; border-radius: 8px;
  font-size: 14px; background: #fff; color: #2a2218; outline: none; font-family: inherit;
}
.search-wrap input:focus { border-color: #5a8a3c; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #999; font-size: 16px; }
.order-filter select {
  padding: 10px 14px; border: 0.5px solid #ccc; border-radius: 8px;
  font-size: 14px; background: #fff; color: #2a2218; outline: none; cursor: pointer; font-family: inherit;
}
.order-filter select:focus { border-color: #5a8a3c; }

.toolbar button {
  padding: 10px 18px; border: none; border-radius: 8px;
  background: #5a8a3c; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s ease;
}
.toolbar button:hover { background: #4d7a34; }
.toolbar button:disabled { opacity: 0.6; cursor: not-allowed; }
.pdf-list-button { white-space: nowrap; }
.inventory-button { white-space: nowrap; }
.sheets-button { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1rem;
}
.tag-filter-button {
  border: 1px solid #d7d3c7;
  background: #fff;
  color: #4f5d46;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-filter-button:hover { background: #f3f1ea; }
.tag-filter-button.active {
  background: #5a8a3c;
  border-color: #4d7a34;
  color: #fff;
}
.plant-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.plant-tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.color-chip { background: #f5f4f0; color: #4a4a3a; border: 0.5px solid #ddd; }
.color-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-right: 5px; border: 0.5px solid rgba(0,0,0,0.15); }

.list-header {
  display: grid; grid-template-columns: 1fr 250px 250px 250px 100px 100px;
  padding: 8px 16px; font-size: 11px; font-weight: 500; color: #888;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid #ddd; margin-bottom: 4px;
}

.plant-list { display: flex; flex-direction: column; }

.plant-row {
  display: grid;
  grid-template-columns: 1fr 250px 250px 250px 100px 100px;
  grid-template-rows: auto auto auto;
  align-items: start;
  padding: 10px 16px;
  background: #fff; border: 0.5px solid #e0dbd0;
  border-radius: 10px; margin-bottom: 8px;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}
.plant-row { color: inherit; text-decoration: none; }
.plant-row:hover { border-color: #5a8a3c; box-shadow: 0 2px 12px rgba(90,138,60,0.1); }

/* Row 1 items — all bottom-aligned so text sits on the same baseline */
.plant-family    { grid-column: 2; grid-row: 1; min-width: 0; overflow-wrap: break-word; align-self: end; }
.plant-genus     { grid-column: 3; grid-row: 1; min-width: 0; overflow-wrap: break-word; align-self: end; }
.plant-species   { grid-column: 4; grid-row: 1; min-width: 0; overflow-wrap: break-word; align-self: end; }
.thumb-col       { grid-column: 5; grid-row: 1 / 3; display: flex; align-items: center; justify-content: center; }

/* Col 6 — spans all 3 rows */
.qr-col          { grid-column: 6; grid-row: 1 / 4; display: flex; justify-content: flex-end; }

/* Row 2 items */
.plant-row2-color     { grid-column: 1; grid-row: 2; font-size: 11px; color: #888; padding-top: 8px; }
.plant-row2-grownby   { grid-column: 2; grid-row: 2; font-size: 11px; color: #888; padding-top: 8px; }
.plant-row2-labels    { grid-column: 3; grid-row: 2; font-size: 11px; color: #888; font-weight: 500; padding-top: 8px; }
.plant-row2-purchased { grid-column: 4; grid-row: 2; font-size: 11px; color: #888; font-weight: 500; padding-top: 8px; }

/* Row 3 — tags span cols 1–4 (col 5 reserved for Edit button) */
.plant-row3-tags { grid-column: 1 / 5; grid-row: 3; padding-top: 8px; }

.plant-thumb {
  width: 90px; height: 90px; border-radius: 6px;
  object-fit: cover; display: block;
  border: 0.5px solid #e0dbd0; flex-shrink: 0;
}
.plant-thumb-empty {
  width: 90px; height: 90px; border-radius: 6px;
  background: #f0ede5; border: 0.5px solid #e0dbd0; flex-shrink: 0;
}

.plant-name {
  grid-column: 1; grid-row: 1; min-width: 0; overflow-wrap: break-word; align-self: end;
  font-size: 16px; font-weight: 600; color: #1e2a1a;
  display: block; line-height: 1.2;
}
.plant-name:hover { color: inherit; }
.plant-family,
.plant-genus,
.plant-species { font-size: 16px; font-weight: 600; color: #1e2a1a; line-height: 1.2; }
.qr-wrap {
  width: 90px; height: 90px; background: #fff;
  border: 0.5px solid #ddd; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 4px; flex-shrink: 0;
}
.qr-wrap canvas, .qr-wrap img { width: 100% !important; height: 100% !important; }

.loader { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem; gap: 16px; }
.spinner { width: 36px; height: 36px; border: 3px solid #e0dbd0; border-top-color: #5a8a3c; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { font-size: 14px; color: #999; }

.empty { text-align: center; padding: 3rem; color: #aaa; font-size: 15px; }
.error-state { text-align: center; padding: 3rem; color: #A32D2D; font-size: 15px; background: #FCEBEB; border-radius: 10px; border: 0.5px solid #F7C1C1; }
.error-state strong { display: block; margin-bottom: 8px; font-size: 16px; }
.error-state code { font-size: 12px; color: #993535; background: #fff; padding: 2px 6px; border-radius: 4px; }

.edit-col { grid-column: 5; grid-row: 3; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; }
.edit-btn {
  width: 100%;
  height: auto;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: #5a8a3c;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
  padding: 16px 8px;
}
.edit-btn:hover { background: #4d7a34; }

.edit-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.edit-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 480px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}
.edit-modal h2 { font-size: 18px; color: #1e2a1a; margin-bottom: 20px; font-weight: 600; }
.edit-field { margin-bottom: 14px; }
.edit-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}
.edit-field input[type="text"],
.edit-field input[type="file"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #2a2218;
  outline: none;
  background: #fff;
}
.edit-field input[type="text"]:focus { border-color: #5a8a3c; }
.edit-field input[type="file"] { padding: 7px 10px; background: #fafaf8; }
.edit-field-hint { font-size: 11px; color: #999; margin-top: 5px; display: block; }
.edit-field-divider { border-top: 1px solid #eee; margin: 6px 0 14px; }
.edit-image-preview {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e0dbd0;
  margin-bottom: 8px;
  display: block;
}
.edit-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.edit-cancel-btn, .edit-save-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}
.edit-cancel-btn { background: #f0ede5; color: #4f5d46; }
.edit-cancel-btn:hover { background: #e5e1d8; }
.edit-save-btn { background: #5a8a3c; color: #fff; }
.edit-save-btn:hover { background: #4d7a34; }
.edit-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

footer { text-align: center; padding: 2rem; font-size: 12px; color: #aaa; border-top: 1px solid #e0dbd0; margin-top: 2rem; }

@media (max-width: 640px) {
  .hero { padding: 2rem 1.25rem 1.75rem; }
  .hero h1 { font-size: 36px; }
  .hero-logo {
    position: static;
    display: block;
    height: 80px;
    margin: 0 auto 1rem;
    transform: none;
  }

  .main { padding: 1.5rem 1rem; }

  .order-filter { flex: 1 1 100%; }
  .order-filter select { width: 100%; }
  .pdf-list-button { display: none; }
  .inventory-button { display: none; }
  .sheets-button { display: none;}

  .tag-filter-bar { display: none}

  .list-header { display: none; }

  .plant-row { grid-template-columns: 200px 1fr; }
  .plant-row2-grownby,
  .plant-row2-labels,
  .plant-row2-purchased,
  .plant-family,
  .plant-genus,
  .plant-species,
  .edit-col,
  .qr-col { display: none; }
}
