:root {
  --red: #b3141a;
  --red-dk: #8f1015;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  border-radius: 12px;
  padding: 28px 26px;
}
h1 { margin: 0 0 18px; font-size: 22px; }
label { display: block; margin: 0 0 14px; font-weight: 600; font-size: 13px; }
input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 400;
  border: 1px solid #cbd0d8;
  border-radius: 8px;
}
input:focus { outline: 2px solid var(--red); border-color: var(--red); }
button, .btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--red-dk); }
.muted { color: var(--muted); font-size: 13px; margin-top: 16px; }
.muted a, a { color: var(--red-dk); }
.error {
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: #8f1015;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0 0 12px;
}

/* ---- Landing page (index.php) ---- */
body.home { background: #fff; }
.landing {
  text-align: center;
  padding: 24px;
}
.landing .logo {
  display: block;
  width: 260px;
  max-width: 80%;
  height: auto;
  margin: 0 auto 26px;
}
.landing-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.landing-actions .btn {
  width: auto;
  min-width: 130px;
}
.btn-outline {
  background: #fff;
  color: var(--red-dk);
  border: 2px solid var(--red);
}
.btn-outline:hover {
  background: #fdecec;
}

/* Logo above the login / register forms (~half the landing size) */
.form-logo {
  display: block;
  width: 130px;
  height: auto;
  margin: 0 auto 16px;
}

/* Login / register without a card - just logo + form on white */
.formpage {
  max-width: 340px;
  margin: 0 auto;
  text-align: left;
}
.formpage h1 { text-align: center; margin-bottom: 18px; }
.formpage .form-logo { margin-bottom: 14px; }

/* ---- Members page (upload + inventory table) ---- */
.members-wrap { max-width: 1150px; margin: 0 auto; padding: 24px; }
.members-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.members-top .form-logo.small { width: 64px; margin: 0; }
.center-logo { display: block; width: 96px; margin: 4px auto 12px; }
.members-top .spacer { flex: 1; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }
.upload {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 6px; padding: 14px; border: 1px solid var(--line);
  border-radius: 8px;
}
.upload .filelabel { font-weight: 600; font-size: 13px; }
.upload input[type=file] { display: block; margin-top: 6px; font-weight: 400; }
.upload button { width: auto; }
.notice {
  background: #eaf7ee; border: 1px solid #bfe3c9; color: #1e7a37;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 0 0 12px;
}
.summary { margin: 14px 0; font-size: 14px; }
.summary .inline { display: inline; }
.btn-link {
  background: none; border: 0; color: var(--red-dk); text-decoration: underline;
  cursor: pointer; width: auto; padding: 0 0 0 10px; font-size: 13px; font-weight: 600;
}
.table-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 8px;
  max-height: 70vh;
}
.data-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.data-table th, .data-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap;
}
.data-table th {
  background: var(--red); color: #fff; position: sticky; top: 0;
}
.data-table tbody tr:nth-child(even) { background: #faf7f7; }
.data-table td.num { text-align: right; }
.data-table th:last-child, .data-table td:last-child {
  white-space: normal; min-width: 220px;
}

/* ---- Web app: toolbar, forms, actions, thumbs ---- */
.members-wrap.narrow { max-width: 640px; }
.toolbar { display:flex; align-items:center; gap:12px; margin:10px 0; flex-wrap:wrap; }
.toolbar .inline { display:inline; }
.toolbar select { padding:6px 8px; border:1px solid #cbd0d8; border-radius:6px; }
.data-table td.actions { white-space:nowrap; }
.data-table td.actions a { margin-right:8px; }
.btn-link.danger { color:#a11; }
.catpick { margin:8px 0 14px; }
.catpick select { padding:8px 10px; border:1px solid #cbd0d8; border-radius:6px; font-size:15px; }
.itemform .field { margin-bottom:12px; }
.itemform label { display:block; font-weight:600; font-size:13px; margin-bottom:4px; }
.itemform input[type=text], .itemform input[type=date], .itemform input[type=number],
.itemform select, .itemform textarea {
  width:100%; padding:9px 11px; border:1px solid #cbd0d8; border-radius:8px; font-size:15px;
}
.itemform .handload { background:#f7f3ea; border-left:3px solid #d9b45a; padding:8px 10px; border-radius:6px; }
.formbtns { display:flex; gap:12px; margin-top:16px; }
.formbtns .btn { width:auto; }
.sub { margin-top:22px; }
.thumbs { display:flex; flex-wrap:wrap; gap:12px; }
.thumb { width:120px; text-align:center; }
.thumb img { width:120px; height:120px; object-fit:cover; border:1px solid var(--line); border-radius:8px; }
.thumb .btn-link { font-size:12px; }

/* import radio choices */
.itemform label.radio {
  display:flex; align-items:center; gap:8px; font-weight:400; margin:6px 0;
}
.itemform label.radio input { width:auto; }
