﻿.spreadsheet-container {
  margin-bottom: 2vh;
  max-height: 63vh;
  overflow: auto;
  position: relative;
  border: 1px solid #ddd;
}

.spreadsheet-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
}

  .spreadsheet-table th, .spreadsheet-table td {
    border: 1px solid #ddd;
    text-align: center;
    min-width: 4vw;
  }

  .spreadsheet-table thead th {
    position: sticky;
    z-index: 10;
    background-color: #4682B4; /* Deep Blue */
    color: white;
  }

  /* First header row */
  .spreadsheet-table thead tr:first-child th {
    top: 0;
    z-index: 20;
    height: 5vh;
  }

  /* Second header row */
  .spreadsheet-table thead tr:nth-child(2) th {
    top: 5vh;
    z-index: 15;
    height: 4vh;
  }

th.date-header {
  font-weight: bold;
  min-width: 11vw !important;
}

th.entity-header {
  min-width: 11vw !important;
  position: sticky;
  left: 0;
  z-index: 35 !important;
}

th.previous-date-header {
  position: sticky;
  left: 11vw; /* matches min-width of entity-header */
  z-index: 35 !important;
}

.previous-anchor-header {
  position: sticky;
  z-index: 35 !important;
}

.complex-type-header {
  background-color: #f0f0f0;
}

.entity-cell {
  background-color: #f0f0f0;
  position: sticky;
  left: 0;
  z-index: 5 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11vw;
}

.previous-reading-cell {
  position: sticky;
  z-index: 5 !important;
}

.table-wrapper {
  width: 100%;
}

.non-editable-cell {
  background-color: #f0f0f0;
  min-height: 4vh;
}

.editable-cell {
  padding: 0 !important;
  background-color: white;
}

  .editable-cell input {
    width: 100%;
    height: 100%;
    min-height: 4vh;
    border: none;
    text-align: center;
    background-color: transparent;
    padding: 1vh 0.5vw;
    box-sizing: border-box;
  }

    .editable-cell input:focus {
      outline: none;
      box-shadow: inset 0 0 0 0.2vh #1890ff; /* Inner blue border */
    }

    .editable-cell input[type="number"]::-webkit-inner-spin-button,
    .editable-cell input[type="number"]::-webkit-outer-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

.actions-container {
  margin-top: 2vh;
}

.input-invalid {
  outline: none; /* Remove default outline */
  box-shadow: inset 0 0 0 0.2vh #dc3545; /* Inner red border */
}

.input-duplicate {
  background-color: #ffcccc !important; /* Light red background */
}
