/* Plant reports and file access use the existing day/night section tokens. */
.plant-records-report {
  display: grid;
  gap: 20px;
}
.report-heading,
.report-preview-heading,
.report-section-heading,
.report-controls-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.report-controls,
.report-preview,
.report-saved {
  padding: 20px;
}
.report-heading h2,
.report-preview-heading h2,
.report-section-heading h2,
.report-section-heading h3 {
  margin: 4px 0;
}
.report-heading p,
.report-preview-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}
.report-format {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: nowrap;
  font-size: 13px;
}
.report-period {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 200px) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  margin: 18px 0;
}
.report-period label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}
.report-title-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.report-title-info :is(h2,h3) { min-width: 0; overflow-wrap: anywhere; }
.report-title-info > .info-button, .report-highlight > .info-button { flex: none; }
.report-period-info { align-self: center; font-size: 13px; color: var(--muted); }
.report-section-heading { margin-bottom: 10px; }
.report-section-heading > span { flex: none; }
.report-controls-footer { justify-content: flex-end; }
.report-options {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.report-options legend {
  padding: 0 0 10px;
  font-weight: 600;
}
.report-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.report-option.selected {
  border-color: var(--theme-accent, #267744);
  background: color-mix(in srgb, var(--theme-accent, #267744) 10%, transparent);
}
.report-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--theme-accent, #267744);
}
.report-controls-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.report-controls-footer > span,
.report-section-heading > span {
  color: var(--muted);
  font-size: 14px;
}
.report-start {
  padding: 26px 12px;
  text-align: center;
  color: var(--muted);
}
.report-start h2 {
  color: var(--ink);
}
.report-preview-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.report-notices {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid #b57b1a;
  border-radius: 10px;
  background: color-mix(in srgb, #edaa37 9%, transparent);
}
.report-notices summary {
  font-weight: 700;
  cursor: pointer;
}
.report-notices ul {
  margin-bottom: 0;
  padding-left: 20px;
  max-height: 220px;
  overflow: auto;
}
.report-notices li {
  margin: 8px 0;
}
.report-section {
  margin-top: 26px;
  min-width: 0;
}
.report-table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.report-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  min-width: 560px;
  color: var(--ink);
  font-size: 14px;
}
.report-table th {
  text-align: left;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: top;
  line-height: 1.45;
}
.report-table tr:last-child td {
  border-bottom: 0;
}
.report-table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-soft) 45%, transparent);
}
.report-empty,
.report-check-note {
  padding: 16px 0;
  color: var(--muted);
}
.report-section > button {
  margin-top: 12px;
}
.report-message,
.report-loading,
.report-access {
  padding: 20px;
  border-radius: 12px;
}
.report-message.error {
  border: 1px solid #c35757;
}
.report-message.success {
  border: 1px solid var(--theme-accent, #267744);
}
.report-saved ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.report-saved li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.report-saved li > div:first-child {
  min-width: 0;
}
.report-saved strong {
  overflow-wrap: anywhere;
}
.report-saved span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.report-file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.vault-doc-row.file-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  border-radius: 0;
}
.vault-doc-row.file-access-row.active {
  background: color-mix(
    in srgb,
    var(--theme-accent, #267744) 9%,
    var(--surface)
  );
  box-shadow: inset 3px 0 var(--theme-accent, #267744);
}
.file-select {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  min-width: 0;
  cursor: pointer;
  font: inherit;
}
.file-select .file-icon {
  width: 38px;
  height: 46px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
}
.file-select .vault-doc-main {
  min-width: 0;
  flex: 1;
}
.file-row-chevron { font-size: 22px; flex: none; }
.file-select:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 5px; border-radius: 4px; }
.file-inline-details { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.file-inline-details[hidden] { display: none; }
.file-availability { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.file-management-actions, .file-deletion-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.file-deletion-actions { flex: 1 1 260px; }
.file-deletion-actions .form-hint { flex: 1 1 240px; margin: 0; }
.file-inline-details .file-detail-clean details { padding-top: 12px; margin-top: 12px; }
.file-inline-details .vault-lineage-panel { margin-top: 12px; }
.file-inline-details .vault-lineage-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.file-inline-details .vault-lineage-list > div { padding: 12px; }
.file-inline-details .vault-lineage-copy { min-width: 0; overflow-wrap: anywhere; }
.file-select strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.4;
}
.file-select .row-meta {
  margin-top: 6px;
  gap: 10px;
  font-size: 13px;
}
.file-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.file-row-actions .button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}
.vault-detail.file-detail-clean {
  padding: 22px;
  min-width: 0;
}
.file-detail-clean .vault-detail-head {
  padding: 0 0 18px;
}
.file-detail-clean .vault-detail-head h2 {
  overflow-wrap: anywhere;
  font-size: 18px;
}
.file-detail-clean .vault-actions-grid {
  padding: 0;
  margin-bottom: 20px;
}
.file-detail-clean .vault-detail-grid {
  padding: 0;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.file-detail-clean details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 18px;
}
.file-detail-clean summary {
  cursor: pointer;
  font-weight: 600;
}
.file-detail-clean .file-other-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
}
.file-detail-clean .vault-lineage {
  padding: 16px 0 0;
}
.file-detail-clean .vault-protocol-links {
  padding: 14px 0 0;
}
@media (min-width: 1000px) {
  .vault-intel-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
  .vault-detail.file-detail-clean {
    position: sticky;
    top: 100px;
  }
}
@media (max-width: 1100px) {
  .file-access-row .file-row-actions {
    flex-direction: column;
  }
  .report-period {
    grid-template-columns: 1fr 1fr;
  }
  .report-period-info {
    grid-column: 1/-1;
  }
}
@media (max-width: 700px) {
  .report-controls,
  .report-preview,
  .report-saved {
    padding: 16px;
  }
  .report-heading,
  .report-preview-heading,
  .report-controls-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .report-format {
    align-self: flex-start;
  }
  .report-option {
    flex: 1 1 145px;
  }
  .report-period {
    gap: 12px;
  }
  .report-period input {
    min-width: 0;
    width: 100%;
  }
  .report-saved li {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .vault-doc-row.file-access-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
    gap: 12px;
  }
  .file-access-row .file-row-actions {
    flex-direction: row;
    padding-left: 52px;
  }
  .report-section-heading {
    gap: 12px;
  }
  .report-table-scroll {
    max-width: 100%;
  }
  .vault-intel-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.file-detail-clean .vault-actions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.file-detail-clean .vault-actions-grid .button {
  white-space: nowrap;
  padding: 10px;
}

/* Keep the section's soft button palette during hover; legacy solid hover
   backgrounds otherwise make the theme's green text unreadable. */
.app-shell .main .plant-records-report .button.primary:hover:not(:disabled) {
  background: var(--theme-soft);
  color: var(--theme-accent);
}

.report-presets { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:16px; }
.report-presets > span { color:var(--muted); font-size:13px; margin-right:4px; }
.report-highlights { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:16px 0; }
.report-highlight { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; border:1px solid var(--border); border-left:3px solid var(--chart-color); border-radius:8px; padding:10px 12px; background:var(--surface); min-width:0; }
.report-highlight > strong { font-size:24px; color:var(--chart-color); line-height:1.1; font-variant-numeric:tabular-nums; }
.report-highlight > span { font-size:14px; font-weight:650; line-height:1.4; overflow-wrap:anywhere; }
.report-highlight > small { grid-column:1/-1; color:var(--muted); }
.report-preview-guide { margin:0; font-size:12px; color:var(--muted); }
.report-source-link { color:var(--theme-accent,var(--ink)); text-align:left; text-decoration:underline; text-underline-offset:3px; background:transparent; border:0; padding:8px 0; min-height:44px; font:inherit; cursor:pointer; overflow-wrap:anywhere; }
.report-source-link:focus-visible { outline:2px solid var(--theme-accent); outline-offset:3px; }
@media(max-width:1000px) { .report-highlights { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .report-highlights { grid-template-columns:1fr; } .report-section-heading { align-items:flex-start; flex-wrap:wrap; } }

/* Report writer: one compact setup row, with optional section choices. */
.report-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.report-customize { border-top:1px solid var(--line); padding-top:12px; }
.report-customize summary { cursor:pointer; font-weight:600; padding:8px 0; }
.report-customize summary span { font-weight:400; color:var(--muted); }
.report-customize .report-options { margin-top:12px; }
.report-period { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.report-period label { flex:0 1 200px; min-width:0; }
.report-date-summary { color:var(--muted); font-size:14px; }
.report-period .input { min-width:0; width:100%; }
@media(max-width:700px) {
  .report-period label { flex:1 1 140px; }
  .report-presets .button { flex:1 1 150px; }
}
