/* SeedVue — minimal Phase 1 styling */
:root {
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f8f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: 1rem 1.5rem;
  background: var(--green);
  color: #fff;
}
.topbar h1 { margin: 0; font-size: 1.12rem; letter-spacing: .5px; }
.topbar .subtitle { color: #d7f0d8; font-size: .95rem; }

.container { max-width: 980px; margin: 0 auto; padding: 1.5rem; }

.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input[type="text"] {
  flex: 1; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: 6px; font-size: 1rem;
}
.search input[type="submit"] {
  padding: .55rem 1rem; border: 0; border-radius: 6px;
  background: var(--green); color: #fff; font-size: 1rem; cursor: pointer;
}
.search .clear { align-self: center; color: var(--muted); }

.count { color: var(--muted); margin: .25rem 0 1rem; font-size: .9rem; }

.grid { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.grid th, .grid td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.grid thead th { background: #f0f4f0; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .4px; color: var(--muted); }
.grid tbody tr:hover { background: #fafdfa; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.grid a { color: var(--green-dark); font-weight: 600; text-decoration: none; }
.grid a:hover { text-decoration: underline; }

.back { color: var(--green-dark); text-decoration: none; }
.muted { color: var(--muted); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.25rem; margin: 1rem 0;
}
.card h3 { margin-top: 0; }
.pls-badge {
  margin-left: .5rem; font-size: .85rem; font-weight: 600;
  background: var(--green); color: #fff; padding: .15rem .5rem; border-radius: 999px;
}

.details { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem .75rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; }

/* Account / auth */
.accountbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.5rem; background: #fff; color: var(--ink); font-size: .9rem;
  border-bottom: 1px solid var(--line);
}
.accountbar .brand { display: inline-flex; align-items: center; text-decoration: none; }
.accountbar .brand-logo { height: 2.73rem; width: auto; display: block; }
.accountbar .spacer { flex: 1; }
.accountbar .mainnav { display: flex; gap: 1rem; margin-left: 1.25rem; }
.accountbar .mainnav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.accountbar .mainnav a:hover { color: var(--green-dark); }
.accountbar .account-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.accountbar .account-name { font-weight: 600; color: var(--ink); }
.accountbar .user-email { color: var(--muted); font-size: .82rem; }
.accountbar .signout button,
.accountbar form.signout button {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: .3rem .7rem; cursor: pointer; font-size: .85rem;
}
.accountbar .signout button:hover { background: var(--bg); }

.flash { padding: .7rem 1.5rem; font-size: .9rem; }
.flash.notice { background: #e8f5e9; color: var(--green-dark); }
.flash.alert { background: #fdecea; color: #b71c1c; }

.auth { max-width: 420px; }
.auth-logo { display: block; height: 40px; width: auto; margin: .5rem 0 1.25rem; }
.auth h1 { font-size: 1.4rem; }
.auth .field { margin-bottom: .9rem; }
.auth label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.auth input[type="text"],
.auth input[type="email"],
.auth input[type="password"] {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: 6px; font-size: 1rem;
}
.auth input[type="submit"] {
  padding: .55rem 1.1rem; border: 0; border-radius: 6px;
  background: var(--green); color: #fff; font-size: 1rem; cursor: pointer;
}
.auth-alt { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--green-dark); }
.form-errors {
  background: #fdecea; color: #b71c1c; border-radius: 6px;
  padding: .7rem .9rem; margin-bottom: 1rem; font-size: .9rem;
}
.form-errors ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-block; padding: .5rem 1rem; border-radius: 6px;
  font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; line-height: 1.2;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: #fff; color: #b71c1c; border-color: #f1c4c0; }
.btn-danger:hover { background: #fdecea; }

/* Index: search / count on the left, New … button on the right */
.list-actions { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.list-actions .search { flex: 1; margin-bottom: 0; }
.list-actions .spacer { flex: 1; }
.list-actions .count { margin: 0; }

/* Inline row actions in catalog grids */
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; margin: 0; }
.row-actions a { margin-right: .6rem; }
.link-danger {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: #b71c1c; font: inherit; font-weight: 600;
}
.link-danger:hover { text-decoration: underline; }

/* Detail page header with actions */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.detail-head h2 { margin-bottom: .15rem; }
.record-actions { display: flex; gap: .5rem; align-items: center; }
.record-actions form { margin: 0; }

/* Record form (lots, catalog, …) */
.record-form { max-width: 720px; }
.record-form .field { margin-bottom: .9rem; }
.record-form .field-row { display: flex; gap: 1rem; }
.record-form .field-row .field { flex: 1; }
.record-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.record-form input[type="text"],
.record-form input[type="number"],
.record-form select,
.record-form textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: 6px; font-size: 1rem; background: #fff; font-family: inherit;
}
.record-form .field.check { display: flex; gap: .5rem; align-items: center; }
.record-form .field.check label { margin-bottom: 0; }
.record-form .field.check input[type="checkbox"] { width: auto; }
.record-form .is-hidden { display: none; }
.record-form .hint { font-size: .8rem; margin: .15rem 0 .6rem; }
.record-form .pls-block {
  border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem 1rem;
  margin-top: 1rem;
}
.record-form .pls-block legend { font-weight: 600; padding: 0 .35rem; color: var(--ink); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.card-head h3 { margin: 0; }
.record-form .form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem; }
.record-form input[type="submit"] {
  padding: .55rem 1.1rem; border: 0; border-radius: 6px;
  background: var(--green); color: #fff; font-size: 1rem; cursor: pointer; font-weight: 600;
}
.record-form input[type="submit"]:hover { background: var(--green-dark); }

/* Inventory import preview/summary */
.record-form fieldset.field { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; }
.record-form fieldset.field legend { font-weight: 600; padding: 0 .35rem; }
.record-form label.radio { display: flex; gap: .5rem; align-items: baseline; margin: .35rem 0; font-weight: normal; }
.record-form label.radio input { width: auto; }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase;
  background: var(--green); color: #fff; border-radius: 4px; padding: .05rem .35rem; margin-left: .3rem;
}
.needs-attention { color: #b45309; font-weight: 600; }
input.needs-attention { border-color: #d97706; background: #fffbeb; }
.summary-stats { margin: 1rem 0; padding-left: 1.1rem; line-height: 1.6; }
.tag-create { background: var(--green); }
.tag-update { background: #b45309; }
.change { font-size: .85rem; color: var(--ink); }
tr.row-unchanged td { color: var(--muted); }
.table-scroll { overflow-x: auto; }
