:root {
  --bg: #f4efe6;
  --surface: #fffdf8;
  --surface-strong: #f3ead9;
  --border: #1f1a17;
  --grid: #26211d;
  --accent: #bb4e18;
  --accent-strong: #93370b;
  --text: #231b14;
  --muted: #695a4f;
  --shadow: rgba(35, 27, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(187, 78, 24, 0.12), transparent 28%),
    linear-gradient(180deg, #f7f1e7 0%, #efe4cf 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  padding: 24px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent-strong);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1;
}

.hero-copy {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--muted);
}

.hero-badge {
  min-width: 150px;
  padding: 18px 20px;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, #fffaf1, #ecdab7);
  box-shadow: 0 12px 24px var(--shadow);
  text-align: center;
}

.hero-badge span {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}

.hero-badge small {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.table-card {
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 0 18px 45px var(--shadow);
  overflow: hidden;
}

.table-toolbar {
  overflow: hidden;
  border-bottom: 2px solid var(--grid);
  background: #f8efdd;
}

.table-toolbar-inner {
  position: relative;
  min-height: 48px;
}

.table-wrap {
  overflow: auto;
}

.coc-table {
  width: 100%;
  min-width: 1740px;
  border-collapse: collapse;
  table-layout: fixed;
}

.coc-table th,
.coc-table td {
  border: 2px solid var(--grid);
  padding: 0;
  vertical-align: top;
  background: white;
}

.coc-table thead th {
  height: 86px;
  padding: 10px 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  background: #fffefa;
}

#dateSampledHeader {
  height: 152px;
  vertical-align: top;
}

#commentsHeader {
  height: 152px;
  vertical-align: top;
}

.coc-table thead th.vertical {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  padding: 12px 2px;
}

.coc-table thead th.analysis-head {
  width: 78px;
  font-size: 0.95rem;
  padding: 6px 4px;
}

.analysis-head {
  position: relative;
}

.header-checkbox-label {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
}

.analysis-head span {
  display: block;
  margin-top: 8px;
}

.coc-table .row-number {
  height: 106px;
  padding: 12px 4px;
  font-size: 1rem;
  text-align: center;
  vertical-align: middle;
  background: #fffcf4;
}

.field-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 104px;
  padding: 8px;
}

.header-field-shell {
  min-height: 140px;
  padding: 6px 4px 8px;
}

.comments-header-shell textarea {
  min-height: 72px;
}

.header-field-title {
  display: block;
  font-size: 1rem;
  font-weight: 500;
}

.field-shell.compact {
  min-height: 104px;
  padding: 8px 6px;
}

.field-shell input,
.field-shell select,
.field-shell textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #8e8175;
  border-radius: 0;
  background: #fff;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.field-shell textarea {
  min-height: 88px;
  resize: vertical;
}

.checkbox-shell {
  justify-content: center;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  width: 100%;
}

.analysis-checkbox {
  width: 20px !important;
  height: 20px;
  min-height: auto !important;
  cursor: pointer;
}

.date-shortcuts {
  display: flex;
  gap: 6px;
}

.date-shortcuts button,
.add-analysis-button,
.add-sample-button {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.date-shortcuts button {
  flex: 1;
  min-height: 30px;
}

.add-analysis-button {
  position: absolute;
  top: 7px;
  min-height: 34px;
  font-size: 0.76rem;
  font-weight: 600;
}

.date-shortcuts button:hover,
.add-analysis-button:hover,
.add-sample-button:hover {
  background: #ead4b0;
  transform: translateY(-1px);
}

.add-row td {
  padding: 16px;
  background: #fff7ea;
}

.add-sample-button {
  min-height: 46px;
  padding: 0 18px;
  font-weight: 600;
}

.sample-limit-message {
  display: inline-block;
  margin: 0 0 0 12px;
  color: var(--accent-strong);
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.col-number {
  width: 40px;
}

.col-name {
  width: 320px;
}

.col-date {
  width: 190px;
}

.col-time {
  width: 145px;
}

.col-units {
  width: 56px;
}

.col-matrix {
  width: 70px;
}

.col-preserv {
  width: 72px;
}

.col-analysis {
  width: 54px;
}

.col-comments {
  width: 270px;
}

@media (max-width: 900px) {
  .page-shell {
    padding: 14px;
  }

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

  .hero-badge {
    align-self: flex-start;
  }
}
