.timesheet-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(min-content, auto)) min-content; /* 7 columns */
  grid-auto-flow: dense;

  @media screen and (max-width: 1200px ){
    grid-template-columns: min-content auto; /* 2 columns (small screens only) */
  }

  .grid-item {
    display: contents;

    &:first-child {
      .grid-row-header {
        display: contents;
      }
    }
  }

  /* Data row */
  .grid-row {
    display: contents;

    /* Header row */
    /* Not displayed by default, unless it's the first grid-item (top of the table) or unless using mobile layout */
  }

  .grid-row-header {
    display: none;

    /* On smaller screens, transform grid columns into rows */
    @media screen and (max-width: 1200px ){
      .grid-cell {
        grid-column-start: 1;

        &:not(:last-child) {
          border-bottom: none;
        }
      }
    }

    @media screen and (max-width: 1200px ){
      display: contents;
    }
  }

  /* Header row cell */
  .grid-cell-header {
    font-weight: var(--font-weight-semibold);
    color: var(--ink-gray);
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
  }

  /* Subdivided grid cell */
  .grid-cell-subdiv {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;

    @media screen and (max-width: var(--screen-lg) ){
      flex-direction: column;
    }

    em {
      color: var(--ink-gray);
      font-style: normal;
      font-weight: var(--font-weight-medium);
    }
  }

  /* A single cell in the grid */
  .grid-cell {
    position: relative;
    padding: .75rem 2rem 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;

    @media screen and (max-width: 1200px ){
      padding-left: 1rem;
      padding-right: 1rem;
      border-top: 1px solid var(--light-gray);
      border-bottom: none;

      /* Colorize top row only */
      &:first-child {
        background-color: var(--brand-charcoal-lightest);
      }

      &:last-child {
        border-bottom: 1px solid var(--light-gray);
      }
    }

    &.center-content {
      text-align: center;
      align-items: center;

      @media screen and (max-width: 1200px ){
        text-align: left;
        align-items: flex-start;
      }
    }
  }

  .grid-cell__l {
    @media screen and (min-width: 1200px ){
      padding: .75rem 1.5rem 0.75rem 0;
    }
  }
}

/*Do not show the modal close header if the user is on the normal show page*/
main.timesheet {
  .modal__page {
    .page-header, .modal__header {
      display: none;
    }
  }
}

/*Modal specific styles on timesheet index*/
.timesheets {
    .modal__page {
        padding: 0 2rem 1rem 2rem;
    }

  .modal__container {
    .page-header {
      margin-bottom: 1rem;
    }
  }
}

.timesheet__break-duration-input {
  @media screen and (min-width: 768px) {
    width: 50%;
  }
}

.border__yellow {
  border-left: 5px solid var(--yellow);
  padding-left: 5px;
}

.grid-cell__bordered:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
}

@media screen and (min-width: 1200px) {
  .grid-cell__bordered:before {
    right: -10px;
    left: -10px;
    border-left: 5px solid var(--yellow);
  }
}

@media screen and (max-width: 1200px) {
  .grid-cell__bordered:before {
    right: 0;
    left: 10px;
    border-right: 5px solid var(--yellow);
  }
}

