/* Spreadsheet-style archive and date-aware entry enhancements */
button:disabled {
  cursor: not-allowed;
  opacity: .48;
  box-shadow: none !important;
}

.form-date-row {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: end;
  gap: 14px 20px;
}

.date-summary {
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
  padding-bottom: 10px;
}

.date-summary span {
  display: grid;
  gap: 4px;
}

.date-summary strong { color: var(--ink); }

.date-validation-message {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

.reference-panel { margin-bottom: 20px; }

.reference-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.reference-heading h2 {
  margin: 0;
  font-size: 20px;
}

.reference-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.excel-table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid #aeb6c2;
  border-radius: 10px;
}

.excel-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.excel-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  color: #fff;
  text-align: left;
  background: #4472c4;
  border-right: 1px solid #355c9f;
}

.excel-table th:first-child { width: 150px; }
.excel-table th:nth-child(2),
.excel-table th:nth-child(3) { width: 34%; }
.excel-table th:nth-child(4) { width: 22%; }

.excel-table td {
  padding: 14px 12px;
  overflow-wrap: anywhere;
  vertical-align: top;
  line-height: 1.55;
  border-top: 1px solid #c8ced7;
  border-right: 1px solid #d6dbe2;
}

.excel-table tbody tr:first-child td { border-top: 0; }
.excel-table td:last-child,
.excel-table th:last-child { border-right: 0; }
.excel-table tbody tr:nth-child(even) { background: #f8fafc; }

.date-cell {
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.date-cell a { color: var(--blue); }
.date-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.no-log {
  color: #8a94a3;
  text-align: center;
  vertical-align: middle !important;
}

.full-log-table-wrap {
  min-height: 320px;
  max-height: calc(100vh - 285px);
}

.full-log-table td { min-height: 68px; }
.previous-log-wrap { max-height: 330px; }
.previous-log-table td {
  max-height: 190px;
  overflow: auto;
}
.previous-log-table th:first-child { width: 165px; }
.file-input { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .form-date-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .date-validation-message { grid-column: auto; }
  .date-summary { padding: 0; }
  .reference-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .previous-log-wrap { max-height: 360px; }
  .full-log-table-wrap { max-height: 65vh; }
}
