/* Inline detail columns replace the old record drawer on the daily inspection ledger. */
.daily-inspection-page .el-drawer,
.daily-inspection-page .el-overlay:has(.el-drawer) {
  display: none !important;
}

@keyframes daily-grid-fallback-reveal {
  to { visibility: visible; }
}

.daily-inspection-page .enterprise-table {
  min-width: 100%;
  table-layout: fixed;
  visibility: hidden;
  animation: daily-grid-fallback-reveal 0s 1.5s forwards;
}

.daily-inspection-page .enterprise-table.daily-enhancement-ready {
  visibility: visible;
  animation: none;
}

.daily-inspection-page .enterprise-table .cell {
  padding-right: 8px;
  padding-left: 8px;
}

.daily-inspection-page .enterprise-table .el-table__header-wrapper th:not(.daily-record-hidden-header),
.daily-inspection-page .enterprise-table .el-table__body-wrapper td:not(.daily-record-hidden-cell) {
  border-right: 1px solid #d8e0ea !important;
  border-bottom: 1px solid #d8e0ea !important;
}

.daily-inspection-page .enterprise-table .el-table__header-wrapper th:not(.daily-record-hidden-header) {
  border-top: 1px solid #d8e0ea !important;
  background: #f6f8fb;
}

.daily-inspection-page .daily-record-hidden-header,
.daily-inspection-page .daily-record-hidden-cell {
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.daily-inspection-page .daily-record-description-cell .cell,
.daily-inspection-page .daily-record-requirement-cell .cell {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden !important;
  line-height: 1.45;
}

.daily-inspection-page .daily-record-description-cell,
.daily-inspection-page .daily-record-requirement-cell {
  min-width: 0;
  overflow: hidden !important;
}

.daily-inspection-page .daily-record-extra-header .cell {
  white-space: nowrap;
}

.daily-inspection-page .enterprise-table .daily-record-extra-cell {
  vertical-align: top;
}

.daily-inspection-page .enterprise-table .daily-record-photo-cell {
  min-width: 0;
  vertical-align: middle;
}

.daily-inspection-page .enterprise-table .daily-record-photo-cell .cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.daily-inspection-page .enterprise-table .daily-record-extra-cell .cell {
  white-space: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.daily-record-empty {
  color: #98a2b3;
}

.daily-record-photos {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 92px;
}

.daily-record-photos a {
  display: inline-flex;
  width: 100%;
  min-width: 92px;
  max-width: 120px;
  aspect-ratio: 1;
  height: auto;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f8fafc;
}

.daily-record-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.daily-record-photos small {
  position: absolute;
  right: 2px;
  bottom: 2px;
  border-radius: 10px;
  padding: 1px 5px;
  background: rgba(16, 24, 40, .78);
  color: #fff;
  white-space: nowrap;
}

.daily-record-operation-cell {
  position: sticky !important;
  right: 0;
  z-index: 3;
  min-width: 232px;
  background: #fff;
  box-shadow: -3px 0 6px rgba(16, 24, 40, .04);
}

.daily-record-operation-cell .cell {
  white-space: normal;
}

/* Keep the action area reachable after the detail columns expand the table. */
.daily-inspection-page .enterprise-table .el-table__header-wrapper th:last-child,
.daily-inspection-page .enterprise-table .el-table__fixed-right th:last-child,
.daily-inspection-page .enterprise-table .el-table__body-wrapper td.daily-record-operation-cell {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #fff;
  box-shadow: -3px 0 6px rgba(16, 24, 40, .04);
}

.daily-inspection-page .enterprise-table .daily-record-operation-header {
  position: sticky !important;
  right: 0;
  z-index: 4;
  background: #f8fafc;
}

.daily-inspection-page .enterprise-table .el-table__header-wrapper th:last-child {
  z-index: 4;
  background: #f8fafc;
}

.daily-record-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.daily-record-action-button {
  min-width: 0;
  min-height: 28px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 2px 4px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.daily-record-action-button:disabled,
.daily-record-action-button.muted {
  border-color: #d0d5dd;
  color: #98a2b3;
  cursor: default;
}

.daily-record-action-button.warning {
  border-color: #c98500;
  color: #9a6700;
}

.daily-record-action-button:hover {
  border-color: #1677ff;
  color: #1677ff;
}

.daily-record-action-button.primary {
  border-color: #1677ff;
  color: #1677ff;
}

.daily-record-action-button.success {
  border-color: #21844a;
  color: #21844a;
}

.daily-record-action-button.danger {
  border-color: #d92d20;
  color: #b42318;
}

.daily-record-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, .45);
}

.daily-record-modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .22);
}

.daily-record-modal header,
.daily-record-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid #eaecf0;
}

.daily-record-modal header strong {
  color: #1d2939;
  font-size: 17px;
}

.daily-record-modal header button {
  border: 0;
  background: transparent;
  color: #667085;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.daily-record-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.daily-record-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #dbe3ec;
  border-left: 1px solid #dbe3ec;
}

.daily-record-modal-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid #dbe3ec;
  border-bottom: 1px solid #dbe3ec;
}

.daily-record-modal-grid .wide {
  grid-column: 1 / -1;
}

.daily-record-modal-grid dt {
  margin-bottom: 4px;
  color: #667085;
  font-size: 12px;
}

.daily-record-modal-grid dd {
  margin: 0;
  color: #1d2939;
  overflow-wrap: anywhere;
}

.daily-record-modal-body h3 {
  margin: 4px 0 0;
  color: #1d2939;
  font-size: 15px;
}

.daily-record-timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.daily-record-timeline li {
  padding-left: 4px;
  color: #344054;
}

.daily-record-timeline li span,
.daily-record-timeline li p {
  display: block;
  margin: 4px 0 0;
  color: #667085;
  font-size: 12px;
}

.daily-record-timeline .empty {
  color: #98a2b3;
}

.daily-record-modal footer {
  justify-content: flex-end;
  border-top: 1px solid #eaecf0;
  border-bottom: 0;
}

.daily-record-modal footer button {
  min-height: 32px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 0 14px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font: inherit;
}

.daily-record-modal footer button[data-submit] {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

.daily-record-modal footer button[data-submit].danger {
  border-color: #d92d20;
  background: #d92d20;
}

.daily-record-modal footer button[data-submit].success {
  border-color: #21844a;
  background: #21844a;
}

.daily-record-modal-body label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

.daily-record-modal-body label span {
  color: #b42318;
}

.daily-record-modal-body textarea,
.daily-record-modal-body input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 9px 10px;
  color: #1d2939;
  font: inherit;
}

.review-notice,
.review-confirm {
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid #c98500;
  background: #fff8e6;
  color: #694f1d;
  line-height: 1.55;
}

.review-confirm {
  border-left-color: #21844a;
  background: #ecfdf3;
  color: #17603a;
}

.daily-review-error {
  margin: 0;
  color: #b42318;
  font-size: 12px;
}

@media (max-width: 900px) {
  .daily-record-actions {
    min-width: 0;
  }

  .daily-record-action-button {
    padding: 2px 7px;
  }
}

@media (max-width: 640px) {
  .daily-record-modal-overlay {
    align-items: end;
    padding: 0;
  }

  .daily-record-modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 8px 8px 0 0;
  }

  .daily-record-modal-grid {
    grid-template-columns: 1fr;
  }

  .daily-record-modal-grid .wide {
    grid-column: auto;
  }
}
