* { box-sizing: border-box; }
body {
  font-family: 'DM Sans', -apple-system, sans-serif; background: #f9fafb; color: #0f1923;
  margin: 0; padding: 0 0 3rem;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 2rem 0 1.25rem; gap: 1rem;
}
.badge {
  display: inline-block; background: #fdf0f7; color: #9c0560; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
h1 { font-size: 1.6rem; margin: 0 0 4px; font-weight: 700; }
.sub { color: #6b7280; font-size: 13px; margin: 0; line-height: 1.5; }
.logout-link {
  flex-shrink: 0; color: #6b7280; text-decoration: none; font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border: 1.5px solid #e5e7eb; border-radius: 8px; white-space: nowrap;
}
.logout-link:hover { border-color: #C60675; color: #9c0560; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.5rem; margin-bottom: 1.25rem; }
.card h2 { font-size: 1rem; margin: 0 0 1rem; }
label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 4px; }
input, select {
  width: 100%; border: 1.5px solid #e5e7eb; border-radius: 8px; padding: 9px 10px;
  font-family: inherit; font-size: 13px; color: #0f1923; background: #fff; margin-bottom: 0.85rem;
}
input:focus, select:focus { outline: none; border-color: #C60675; }
.submit {
  background: #C60675; color: #fff; border: none; border-radius: 8px; padding: 10px 22px;
  font-size: 13px; font-weight: 600; cursor: pointer; width: 100%;
}
.submit:hover { background: #9c0560; }
.error-box { background: #fef2f2; border: 1px solid #fda29b; color: #b42318; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 1rem; }
.success-box { background: #f0fdf4; border: 1px solid #86efac; color: #166534; border-radius: 8px; padding: 10px 14px; font-size: 13px; }

/* ── Excel export / import toolbar ───────────────────────────────────────── */
.excel-toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.excel-toolbar .sub { margin-top: 3px; }
.excel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.excel-btn {
  display: inline-block; font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 9px 16px;
  cursor: pointer; text-decoration: none; white-space: nowrap; border: 1.5px solid transparent;
}
.excel-btn-export { background: #fff; color: #0f1923; border-color: #e5e7eb; }
.excel-btn-export:hover { border-color: #C60675; color: #9c0560; }
.excel-btn-import { background: #C60675; color: #fff; }
.excel-btn-import:hover { background: #9c0560; }
.import-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.import-form input[type=file] { width: auto; margin-bottom: 0; font-size: 12px; padding: 6px; }
.filters-form { margin-bottom: 1rem; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select { margin-bottom: 0; width: auto; min-width: 150px; }
.filter-sep { width: 1px; height: 22px; background: #e5e7eb; margin: 0 2px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: auto; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #f0f0f0; }
th { color: #6b7280; font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.th-hint { display: block; text-transform: none; font-weight: 400; letter-spacing: 0; color: #b0b3ba; font-size: 10px; margin-top: 2px; }
.empty { color: #9ca3af; font-size: 13px; padding: 2rem 0; text-align: center; }

/* ── benchmark grid (pre-populated, edit-in-place cells) ─────────────────── */
.grid-row td { vertical-align: middle; }
.grid-row td:nth-child(1), .grid-row td:nth-child(2), .grid-row td:nth-child(3) {
  color: #6b7280; font-size: 12px; white-space: nowrap;
}
input.cell {
  width: auto; min-width: 56px; margin-bottom: 0; padding: 5px 7px; font-size: 12.5px;
  border-color: #e9eaed;
}
/* Free-text columns stay compact until you actually need to type in them —
   claiming a wide column for every row up front is what was pushing
   "Entered by" off the edge of the screen. */
input.cell-source, input.cell-created-by { width: 72px; transition: width 0.15s; }
input.cell-source:focus, input.cell-created-by:focus { width: 160px; }
input.cell-date { min-width: 118px; }
input.cell-value { width: 68px; font-weight: 600; }
input.cell-sample { width: 56px; }
.cell-status-wrap { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell-status { display: inline-block; width: 14px; text-align: center; font-size: 13px; font-weight: 700; }
.cell-status.saving { color: #9ca3af; }
.cell-status.saved { color: #0ca30c; }
.cell-status.error { color: #b42318; cursor: help; }
.clear-btn {
  background: none; border: none; color: #9ca3af; font-size: 15px; line-height: 1; cursor: pointer;
  padding: 0 2px;
}
.clear-btn:hover { color: #b42318; }

/* ── login page ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  background: #fff; border-radius: 18px; padding: 2.75rem 2.25rem 2.5rem; max-width: 400px; width: 100%;
  box-shadow: 0 24px 64px -12px rgba(15,25,35,0.18), 0 2px 8px rgba(15,25,35,0.06);
  text-align: center;
}
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; background: #C60675;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem;
  box-shadow: 0 8px 20px -6px rgba(198,6,117,0.55);
}
.login-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #9c0560; margin: 0 0 10px;
}
.login-card h1 {
  font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 1.85rem;
  color: #0f1923; margin: 0 0 10px;
}
.login-tag { color: #6b7280; font-size: 13.5px; line-height: 1.55; margin: 0 0 1.75rem; }
.login-card form { text-align: left; }
.login-card .error-box { text-align: left; }
