/* OT Data Validation & Consolidation Tool
   Palette: steel / graphite base with signal colors borrowed from factory-floor
   status indicators (amber = caution, red = stop, green = clear). */

:root {
  --steel-950: #10161c;
  --steel-900: #171f27;
  --steel-800: #202b35;
  --steel-700: #2c3a46;
  --steel-600: #3d4f5e;
  --steel-400: #7c8fa0;
  --steel-200: #c6d2db;
  --steel-100: #e7ecf0;
  --paper: #f5f3ee;

  --signal-red: #c4432b;
  --signal-red-bg: #fbe9e4;
  --signal-amber: #b5811a;
  --signal-amber-bg: #fbf1dc;
  --signal-green: #2f7a4f;
  --signal-green-bg: #e6f2ea;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-data: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --radius: 3px;
  --border: 1px solid var(--steel-600);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--steel-950);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--steel-800); }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--steel-950);
  color: var(--steel-100);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--signal-amber);
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 15px;
}

.topbar .brand small {
  display: block;
  font-weight: 400;
  color: var(--steel-400);
  font-size: 11px;
}

.topbar .who {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--steel-200);
}

.topbar .who button {
  background: transparent;
  border: 1px solid var(--steel-600);
  color: var(--steel-200);
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
}
.topbar .who button:hover { border-color: var(--steel-400); }

/* ---------- Layout containers ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  width: 100%;
  flex: 1;
}

.narrow { max-width: 460px; }

.card {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.card .subtext {
  color: var(--steel-600);
  font-size: 12.5px;
  margin-bottom: 16px;
}

/* ---------- Login screen ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--steel-950);
  padding: 20px;
}

.login-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 32px 30px;
  width: 380px;
  border-top: 4px solid var(--signal-amber);
}

.login-card h1 {
  font-size: 17px;
  margin: 0 0 2px;
}
.login-card .lead {
  color: var(--steel-600);
  font-size: 12.5px;
  margin-bottom: 22px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11.5px;
  text-transform: none;
  color: var(--steel-700);
  margin-bottom: 5px;
  font-weight: 600;
}

.field input[type=text],
.field input[type=password],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--steel-600);
  border-radius: var(--radius);
  font-family: var(--font-data);
  font-size: 13.5px;
  background: #fff;
  color: var(--steel-950);
}

.field textarea { font-family: var(--font-data); }

.field.readonly input {
  background: var(--steel-100);
  color: var(--steel-700);
}

.field .hint { font-size: 11px; color: var(--steel-400); margin-top: 4px; }
.field .error-text { font-size: 11.5px; color: var(--signal-red); margin-top: 4px; }

.lookup-preview {
  background: var(--steel-100);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
}
.lookup-preview div { margin-bottom: 3px; }
.lookup-preview .lbl { color: var(--steel-600); display: inline-block; width: 118px; }

.btn-row { display: flex; gap: 10px; margin-top: 20px; }

button {
  cursor: pointer;
  font-family: var(--font-ui);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
}
button.primary { background: var(--steel-950); color: #fff; }
button.primary:disabled { background: var(--steel-400); cursor: not-allowed; }
button.secondary { background: transparent; border: 1px solid var(--steel-600); color: var(--steel-800); }
button.danger { background: var(--signal-red); color: #fff; }
button.small { padding: 4px 9px; font-size: 11.5px; font-weight: 500; }
button.link-btn { background: none; border: none; color: var(--steel-800); text-decoration: underline; padding: 0; font-weight: 500; }

/* ---------- Session context strip ---------- */
.context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.context-strip .field { margin-bottom: 0; min-width: 140px; }

/* ---------- Paste box ---------- */
textarea.paste-area {
  width: 100%;
  min-height: 160px;
  font-family: var(--font-data);
  font-size: 12.5px;
  padding: 10px;
  border: 1px dashed var(--steel-600);
  border-radius: var(--radius);
  background: var(--steel-100);
  resize: vertical;
}

.parse-error {
  background: var(--signal-red-bg);
  color: var(--signal-red);
  border: 1px solid var(--signal-red);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12.5px;
  margin-top: 10px;
}

/* ---------- Review table ---------- */
.table-scroll { overflow-x: auto; }

table.review {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}
table.review th {
  text-align: left;
  background: var(--steel-900);
  color: var(--steel-100);
  padding: 7px 8px;
  white-space: nowrap;
  font-weight: 600;
}
table.review td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--steel-100);
  vertical-align: top;
}
table.review tr.row-hard td { background: var(--signal-red-bg); }
table.review tr.row-soft td { background: var(--signal-amber-bg); }
table.review tr.row-clean td { background: var(--signal-green-bg); }

table.review input, table.review select {
  width: 100%;
  min-width: 78px;
  font-family: var(--font-data);
  font-size: 12px;
  padding: 4px 5px;
  border: 1px solid var(--steel-600);
  border-radius: 2px;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.hard { background: var(--signal-red); color: #fff; }
.chip.soft { background: var(--signal-amber); color: #fff; }
.chip.clean { background: var(--signal-green); color: #fff; }

.flag-note {
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.4;
}
.flag-note.hard { color: var(--signal-red); }
.flag-note.soft { color: var(--signal-amber); }
.flag-note .accept {
  margin-left: 6px;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--steel-950);
  color: #fff;
  border: none;
  cursor: pointer;
}

.summary-bar {
  position: sticky;
  bottom: 0;
  background: var(--steel-950);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  margin-top: 16px;
}
.summary-bar .counts span { margin-right: 16px; font-size: 12.5px; }
.summary-bar .counts .n { font-weight: 700; font-family: var(--font-data); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--steel-950);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  border-left: 4px solid var(--signal-green);
  font-size: 13px;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.toast.error-toast { border-left-color: var(--signal-red); }

.muted { color: var(--steel-600); }
.small-note { font-size: 11.5px; color: var(--steel-600); margin-top: 8px; }

hr.div { border: none; border-top: 1px solid var(--steel-100); margin: 22px 0; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--steel-600); }
.tabs button {
  background: none;
  border: none;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--steel-600);
  border-bottom: 3px solid transparent;
  border-radius: 0;
}
.tabs button.active { color: var(--steel-950); border-bottom-color: var(--signal-amber); }

@media (max-width: 640px) {
  .container { padding: 18px 12px 40px; }
  .context-strip .field { min-width: 100%; }
}
