body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #1f1f1f;
}

h1 {
  color: #77933c;
  margin: 0;
}

.subtitle {
  margin: 4px 0 0;
  color: #4d4d4d;
}

.app {
  padding: 10px 16px 10px 16px;
}

.status-banner {
  width: 97%;
  padding: 7px 15px;
  border-radius: 5px;
  border: 1px solid #c3cfc2;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin: 10px 10px 3px 0px;
  background: #eef2e9;
  color: #1f1f1f;
}

.status-banner.running-ok {
  background: #dff5d8;
  border-color: #98c37a;
  animation: flash-green 1.2s ease-in-out infinite;
}

.status-banner.running-fail {
  background: #ffe4e0;
  border-color: #e6a2a2;
  animation: flash-red 1.2s ease-in-out infinite;
}

.status-banner.passed {
  background: rgb(119, 147, 60);
  border-color: #5e7a2f;
  color: #fff;
}

.status-banner.failed {
  background: #e74c3c;
  border-color: #c0392b;
  color: #fff;
}

.status-banner.aborted {
  background: #f5b041;
  border-color: #d68910;
  color: #1f1f1f;
}

.status-banner.idle {
  background: #eef2e9;
  border-color: #77933c;
}
.status-banner.operator {
  background: #fbcd8e;
  border-color: #77933c;
}

@keyframes flash-green {
  0% { background-color: #dff5d8; }
  50% { background-color: #c8efc0; }
  100% { background-color: #dff5d8; }
}

@keyframes flash-red {
  0% { background-color: #ffe4e0; }
  50% { background-color: #ffd1ca; }
  100% { background-color: #ffe4e0; }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--nafc-border);
  background: #fff;
}
.logoReport {
  height: 36px;
  width: auto;
}

.status-chip {
  background: #effeef;
  border: 1px solid #77933c;
  color: #446122;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  min-width: 80px;
  text-align: center;
}

.status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
  line-height: 1.1;
}

.app-meta {
  font-size: 9px;
  font-weight: 300;
  margin-right:10px;
  color: #446122;
  text-align: right;
}

.pw-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pw-modal.hidden {
  display: none;
}

.pw-modal-dialog {
  background: #fff;
  border: 1px solid #77933c;
  border-radius: 8px;
  padding: 16px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.pw-label {
  display: block;
  font-weight: 600;
  color: #446122;
  margin-bottom: 8px;
}

.pw-label input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
}

.pw-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 8px;
}

.panel {
  background: #fff;
  border: 1px solid #d7e3cf;
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.panel h2 {
  margin: 0 0 8px;
  color: #55702a;
}

.panel-section {
  margin-bottom: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 3px;
  gap: 4px;
  font-size: 14px;
 width:100%;
}

/* this setts the colour for the Script Select Box shading */
.inputcontainer{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  margin-bottom: 5px;
  border: 1px solid #c3cfc2;
  border-radius: 4px;
  background: rgb(249, 249, 242);
  
}

.field select,
.field input[type="text"] {
  padding: 4px;
  border: 1px solid #c3cfc2;
  border-radius: 4px;
  align-items: "left";
  background: rgb(240, 249, 240);
}

.flexibleinput {
  min-width:0;
   flex-grow: 1;

}
.field.checkbox {
  flex-direction: row;
  align-items: center;
}

.field.checkbox span {
  margin-left: 8px;
}

.maintenanceTools,
.maintenance-row {
  border: 1px dashed #c3cfc2;
  padding: 3px;
  border-radius: 3px;
  margin-top: 1px;
   min-width:0;
   flex-grow: 1;
}

.maintenance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  margin-top: 23px;

}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge-locked {
  background: #e6ecf5;
  color: #2f4b7a;
  border: 1px solid #b4c4e0;
}

.badge-unlocked {
  background: #e1f4e1;
  color: #2f7a2f;
  border: 1px solid #9bc89b;
}

.maintenance-toggle {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

/* this setts the colour for the Maintenance background shading */
.maintenance-tools {
  border: 1px solid #d7e3cf;
  border-radius: 3px;
  padding: 6px;
  background: #d0e4f0;
}

.maintenance-hint {
  font-size: 12px;
  color: #4d4d4d;
  margin-top: 6px;
}

.hidden {
  display: none;
}

.button-row {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.button-row.wrap {
  flex-wrap:nowrap;
}

label {
  font-weight: 600;
}
/*This is the load script button*/
button.load {
   width: 100%;
   font-weight: 800;
}

/* this setts the colour for the Maintenance and general button shading 
To keep things consistant, also update app.js: .modal button { ...*/
button { 
  background: #fafbfb;
  border: 1px solid #77933c; 
  border-color: #394f0a;
  color: #77933c;  
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 800;
  width:65px;
  margin-top: 4px;
}
buttonAltNotUsed {
  
  background: #5da3a5;
  border: 1px solid #77933c; 
  border-color: #77933c;
  color: #fff;  
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  width:65px;
  margin-top: 4px;
}
button.primary {
  background: #77933c;
  border-color: #77933c;
  color: #fff;
  width: 90%;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.summary-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 80vh;
}

table {
  border-collapse: collapse;
  width: 98%;
  table-layout: fixed; /* keep table within viewport and allow wrapping */
  background: #fff;
}

table thead {
  background-color: #f0f3f0;
  border-bottom: 2px solid #77933c;
}

table thead th {
  padding: 10px;
  text-align: left;
  border-bottom: 2px solid #77933c;
  font-size: 13px;
}

table tbody td {
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid #b5c8a3;
  font-size: 13px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

table tbody tr:last-child td {
  border-bottom: none;
}

th:hover {
  background-color: #e6e6e6;
}

.filter-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid #c3cfc2;
  border-radius: 3px;
  font-size: 12px;
}

.active-row {
  outline: 2px solid #77933c;
  background-color: #e6f2ff; /* default highlight */
  border-collapse: separate;
}

.active-row.active-pass {
  background-color: rgba(119, 147, 60, 0.25);
  outline-color: #77933c;
}

.active-row.active-fail {
  background-color: #fdecea;
  outline-color: #e6a2a2;
}

.active-row.active-aborted {
  background-color: #fff3e0;
  outline-color: #d68910;
}

.row-pass td {
  background-color: rgba(119, 147, 60, 0.16) !important;
}

.row-fail td {
  background-color: #fdecea !important;
}

.row-aborted td {
  background-color: #fff3e0 !important;
}

.current-step-highlight {
  background: #fff4cc;
  padding: 2px 4px;
  border-radius: 4px;
}

.editable {
  cursor: text;
}

.cell-editor {
  display: block;
  background-color: oklab(0% 0 0);
  color: #ffffff;
  width: 300%;
  max-width: 1400px;
  min-height: 140px;
  box-sizing: border-box;
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border: 1px solid #77933c;
  padding: 6px 8px;
  font-size: 16px;
  font-family: inherit;
}
/*
.draggable-row {
  cursor: grab;
}

.dragging {
  opacity: 0.5;
}
*/
.drop-target {
  outline: 2px dashed #77933c;
}

.status-pass {
  color: #77933c;
  font-weight: bold;
}

.status-fail {
  color: #c0392b;
  font-weight: bold;
}

.status-aborted {
  color: #b86b00;
  font-weight: bold;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* JSON view helpers (for future data display) */
.json-block {
  max-width: 600px;
}

.json-controls {
  margin-bottom: 4px;
}

.json-controls button {
  padding: 3px 6px;
  margin-right: 4px;
  font-size: 12px;
}

.json-pre {
  font-family: monospace;
  background: #fafafa;
  border: 1px solid #ddd;
  padding: 6px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre;
  overflow-x: auto;
  font-size: 12px;
}

.json-key {
  color: #1a00aa;
  font-weight: bold;
}

.json-string {
  color: #008000;
}

.json-number {
  color: #aa0000;
}

.json-boolean {
  color: #aa5500;
}

.json-null {
  color: #777777;
}

.json-collapse {
  cursor: pointer;
  color: #444;
  font-weight: bold;
  margin-right: 4px;
}

.json-children {
  margin-left: 20px;
}
/* Forced dark mode */
  html[data-theme="dark"]{
    --nafc-ink:#e9efe6;
    --nafc-muted:#b8c0b6;
    --nafc-bg:#0e130f;
    --nafc-panel:#111712;
    --nafc-card:#121a14;
    --nafc-border:#2b3a2c;
    --nafc-shadow:0 12px 30px rgba(0,0,0,.35);
  }

  html[data-theme="dark"] body{
    background: linear-gradient(180deg, var(--nafc-bg) 0%, #0b0f0b 55%, var(--nafc-bg) 100%);
    color: var(--nafc-ink);
  }

  /* Your CSS currently hard-codes white-ish sticky headers */
  html[data-theme="dark"] .topbar,
  html[data-theme="dark"] .nte-topbar{
    background: rgba(15, 20, 15, 0.86);
    border-bottom-color: var(--nafc-border);
  }

  /* Anything that is “white card” in light mode should become dark card */
  html[data-theme="dark"] .brand-logo{ background: #0f1510; border-color: var(--nafc-border); }
  html[data-theme="dark"] .about-card{ color: var(--nafc-ink); border-color: var(--nafc-border); } /* was dark text on light panel :contentReference[oaicite:2]{index=2} */
  html[data-theme="dark"] .service{ background: #111712; border-color: var(--nafc-border); }      /* was #dfe3de :contentReference[oaicite:3]{index=3} */
  html[data-theme="dark"] .service h4, html[data-theme="dark"] .service p{ color: var(--nafc-ink); }                      /* were hard-coded dark :contentReference[oaicite:4]{index=4} */

  html[data-theme="dark"] .fixture{ background: var(--nafc-card); border-color: var(--nafc-border); }
  html[data-theme="dark"] .fixture img{ background: #0f1510; border-color: var(--nafc-border); }  /* was #f3f6f2 :contentReference[oaicite:5]{index=5} */
  html[data-theme="dark"] .fixture p{ color: var(--nafc-ink); }                                   /* was dark :contentReference[oaicite:6]{index=6} */

  /* Form fields are hard-coded white in your contact section :contentReference[oaicite:7]{index=7} */
  html[data-theme="dark"] .contact-grid input,
  html[data-theme="dark"] .contact-grid textarea,
  html[data-theme="dark"] .contact-legal input[type="email"]{
    background: #0f1510;
    color: var(--nafc-ink);
    border-color: #3a4b3b;
  }

  /* Demo UI dark mode contrast fixes */
  html[data-theme="dark"] .panel {
    background: #121814;
    border-color: #2f3d30;
    color: var(--nafc-ink);
  }

  html[data-theme="dark"] .panel h2,
  html[data-theme="dark"] .summary-item,
  html[data-theme="dark"] .maintenance-hint,
  html[data-theme="dark"] label,
  html[data-theme="dark"] .subtitle,
  html[data-theme="dark"] .app-meta {
    color: var(--nafc-ink);
  }

  html[data-theme="dark"] .inputcontainer {
    background: #151d17;
    border-color: #334436;
    color: var(--nafc-ink);
  }

  html[data-theme="dark"] .flexibleinput,
  html[data-theme="dark"] .field select,
  html[data-theme="dark"] .field input[type="text"],
  html[data-theme="dark"] .filter-row input {
    background: #0f1510;
    color: var(--nafc-ink);
    border-color: #3a4b3b;
  }

  html[data-theme="dark"] table {
    background: #121814;
    color: var(--nafc-ink);
  }

  html[data-theme="dark"] table thead {
    background-color: #182219;
    border-bottom-color: #4f6a2e;
  }

  html[data-theme="dark"] table thead th {
    color: var(--nafc-ink);
    border-bottom-color: #4f6a2e;
  }

  html[data-theme="dark"] table tbody td {
    color: var(--nafc-ink);
    border-bottom-color: #334436;
  }
