/* ==================
   DATA TABLE
   ================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e5e5;
  margin-top: 0.875rem;
}

.data-table thead                    { z-index: 1; }
.data-table thead th:first-child     { border-top-left-radius: 9px; }
.data-table thead th:last-child      { border-top-right-radius: 9px; }

.data-table th {
  position: sticky;
  top: var(--sticky-bar-offset, 102px);
  z-index: 1;
  background: #eceee8;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3a3a3a;
  padding: 0.35rem 0.875rem;
  text-align: left;
  border-bottom: 2px solid #d4d4ce;
}

.data-table td {
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: top;
}

.data-table tr[data-href] { cursor: pointer; }
.data-table tr[data-href]:hover td { background: #f8f7f4; }

.data-table tr:last-child td        { border-bottom: none; }
.data-table td.col-wrap             { max-width: 220px; word-wrap: break-word; white-space: normal; }
.data-table td.plant-desc-col       { font-size: 11px; color: var(--cat-muted); }
.data-table tbody tr:hover          { background: #faf9f7; }
.data-table tbody tr.row-highlight  { background: #ede9ff; }
.data-table a                       { color: #7c5cbf; text-decoration: none; font-weight: 500; }
.data-table a:hover                 { text-decoration: underline; }

/* ==================
   SCROLLABLE TABLE CONTAINER
   ================== */

.table-scroll-container {
  overflow: auto;
  height: calc(100vh - 260px);
  min-height: 300px;
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-top: 0.875rem;
}

/* When data-table is inside scroll container, remove duplicate chrome */
.table-scroll-container .data-table { margin-top: 0; box-shadow: none; border: none; border-radius: 0; }
.table-scroll-container .data-table th { top: 0; }

/* ==================
   HOVER-REVEAL ROW EDIT
   ================== */

.row-edit-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 12px;
  cursor: pointer;
  color: #888;
  opacity: 0;
  transition: opacity 0.15s;
}

.data-table tr:hover .row-edit-btn { opacity: 1; }

.row-actions-cell { white-space: nowrap; text-align: right; }

.row-remove-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0.1rem 0.2rem;
}

.data-table tr:hover .row-remove-btn { opacity: 1; }

/* ==================
   MARKER SCORE BADGES
   ================== */

.score-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.score-good    { background: #c6efce; color: #276221; }
.score-het     { background: #ffeb9c; color: #7d5a00; }
.score-bad     { background: #e0e0e0; color: #666666; }
.score-unknown { background: #dbeafe; color: #1e40af; }

/* ==================
   TRIAL STATUS ICONS
   ================== */

.status-icon           { font-size: 16px; font-weight: 700; }
.status-icon--active   { color: #276221; }
.status-icon--finished { color: #a61c00; }

/* ==================
   ADMIN TABLE
   ================== */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e5e5;
  margin-top: 0.875rem;
}

.admin-table th          { background: #f5f5f0; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #666; padding: 0.35rem 0.875rem; text-align: left; border-bottom: 1px solid #e5e5e5; }
.admin-table td          { padding: 0.6rem 0.875rem; border-bottom: 1px solid #f0f0f0; color: #333; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover   { background: #faf9f7; }
.admin-table a                { color: #7c5cbf; text-decoration: none; font-weight: 500; }
.admin-table a:hover          { text-decoration: underline; }

/* ==================
   PLATE PRINT LAYOUT
   ================== */

.plate-layout  { margin-bottom: 2.5rem; page-break-after: always; }
.plate-title   { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; display: flex; gap: 1rem; align-items: baseline; }
.plate-markers { font-size: 0.85rem; color: #555; font-weight: 400; }
.plate-ref     { font-size: 0.8rem; color: #999; font-weight: 400; }
.plate-grid    { border-collapse: collapse; font-size: 11px; }
.plate-grid th { background: #f0f0f0; padding: 3px 6px; text-align: center; border: 1px solid #ccc; font-weight: 600; }

.plate-cell          { border: 1px solid #ccc; width: 62px; height: 52px; vertical-align: top; padding: 2px 3px; }
.plate-cell--control { background: #e8e8e8; }
.plate-cell--empty   { background: #fafafa; }
.plate-cell-number   { font-size: 9px; color: #aaa; }
.plate-cell-plot     { font-weight: 600; font-size: 11px; }
.plate-cell-plant    { font-size: 10px; color: #666; }

/* ==================
   PRINT STYLES
   ================== */

@media print {
  .plate-layout { page-break-after: always; }
  a[href], .back-link { display: none; }
}
