/* Phase 1 Spec Manager visual shell
   Goal: preserve the older internal business-tool feel, not a modern card redesign. */
:root {
  --dark: #263f49;
  --teal: #047b9e;
  --teal-dark: #056880;
  --light-gray: #f3f3f3;
  --line: #d5d5d5;
  --label-red: #7b1e1e;
  --text: #141414;
  --muted: #666;
  --warn: #ad6a00;
  --danger: #9d1c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
}

button, input, select, textarea {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

/* Keyboard-focus visibility: this is a dense, keyboard-heavy internal tool
   (dashboard filters, quote-line grids, status dropdowns) and previously had
   no authored focus style anywhere, relying entirely on the browser default. */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.tab:focus-visible,
.side-nav button:focus-visible {
  outline-offset: -2px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 49px;
  padding: 0 16px 0 24px;
  background: var(--dark);
  color: white;
  border-bottom: 1px solid #12323d;
}

.app-title {
  font-weight: bold;
  letter-spacing: .2px;
}

.login-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-strip select {
  height: 26px;
  min-width: 190px;
  border: 1px solid #b8c7cc;
  background: white;
}

.role-badge, .storage-badge {
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 3px;
  padding: 4px 8px;
  color: #fff;
  background: rgba(255,255,255,.08);
  white-space: nowrap;
}

.storage-badge.fs-ok { background: #225f3f; }
.storage-badge.fs-warn { background: #754d13; }

.small-btn {
  height: 26px;
  padding: 2px 9px;
  border: 1px solid #aab9bf;
  background: #f7f7f7;
  color: #111;
  cursor: pointer;
}
.small-btn:hover { background: #fff; }

.current-user-label {
  font-weight: bold;
  white-space: nowrap;
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--dark);
}

.login-screen[hidden] { display: none; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.login-form h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}

.login-form label {
  font-size: 12px;
  font-weight: bold;
  color: var(--muted);
}

.login-form input {
  height: 30px;
  padding: 0 8px;
  border: 1px solid #b8c7cc;
}

.login-form button {
  margin-top: 8px;
}

.login-error {
  min-height: 16px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

/* .login-form sets display:flex, which would otherwise beat the [hidden] attribute —
   the login and forgot-password forms swap places in the same slot. */
.login-form[hidden] { display: none; }

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* The forgot-password status line is a hint by default and turns into an error in
   place; this rule is needed because .login-hint is declared after .login-error. */
.login-hint.login-error { color: var(--danger); }

/* Secondary, low-emphasis action inside the login card ("Forgot password?"). */
.link-btn {
  margin-top: 4px;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 12px;
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover { color: var(--teal-dark); }

.change-password-panel {
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
  padding: 12px 16px;
}
.change-password-panel[hidden] { display: none; }

.change-password-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.change-password-form label {
  font-size: 12px;
  font-weight: bold;
  color: var(--muted);
}

.change-password-form input {
  height: 30px;
  padding: 0 8px;
  border: 1px solid #b8c7cc;
}

.change-password-form .login-error {
  flex: 1 1 100%;
  order: 5;
}

.change-password-actions {
  display: flex;
  gap: 8px;
}

.tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 36px;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  border-right: 1px solid var(--line);
  background: #f2f2f2;
  cursor: pointer;
  font-weight: bold;
  color: #111;
}

.tab.active {
  background: var(--teal);
  color: white;
}

.main-view {
  padding: 10px 14px 30px 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  border: 1px solid #b8c7cc;
  border-radius: 10px;
  background: #fff;
  color: #203943;
  min-height: 36px;
  padding: 8px 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.action-btn:hover:not(:disabled) {
  border-color: #759daa;
  box-shadow: 0 3px 10px rgba(38,63,73,.12);
  transform: translateY(-1px);
}
.action-btn.primary {
  border-color: var(--teal-dark);
  background: var(--teal);
  color: #fff;
}
.action-btn.danger {
  border-color: #8b1515;
  color: #fff;
  background: var(--danger);
}
.action-btn:disabled {
  color: #9aa5a9;
  background: #edf1f2;
  border-color: #d3dcdf;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.status-note {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-table-wrap {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  table-layout: fixed;
}

.dashboard-table th {
  text-align: left;
  padding: 6px 5px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  background: #f6f6f6;
}

.dashboard-table td {
  padding: 8px 5px;
  border-bottom: 1px solid #cfcfcf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-table tr:hover td {
  background: #f9fbfc;
}

.dashboard-table .filters th {
  padding: 4px 5px;
  background: #ededed;
}

.dashboard-table .filters input {
  width: 100%;
  height: 24px;
  border: 1px solid #eeeeee;
  background: #ffffff;
}

.link-btn {
  border: none;
  background: transparent;
  color: #005f84;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.empty-state {
  padding: 20px;
  border: 1px solid var(--line);
  background: #fafafa;
  color: #444;
}

.form-shell {
  max-width: 1000px;
  margin: 0 auto;
  border-top: 2px solid var(--dark);
  padding-top: 8px;
}

.form-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  padding-bottom: 6px;
}

.form-logo {
  text-align: center;
  color: #58666a;
  font-weight: bold;
  font-style: italic;
  font-size: 12px;
}

.form-back {
  color: var(--muted);
  text-align: right;
  cursor: pointer;
  border: none;
  background: none;
}

.option-bar {
  display: grid;
  grid-template-columns: 1fr repeat(7, minmax(78px, 1fr));
  border: 1px solid var(--line);
  border-bottom: 0;
  height: 36px;
  align-items: stretch;
}

.option-title {
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-weight: bold;
  color: #555;
  border-right: 1px solid var(--line);
}

.option-bar button {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
}
.option-bar button:hover:not(:disabled) { background: #f4f4f4; }
.option-bar button:disabled { color: #aaa; cursor: not-allowed; }

.form-body {
  display: grid;
  grid-template-columns: 1fr 255px;
  gap: 18px;
  border: 1px solid var(--line);
  padding: 18px 20px 18px 10px;
  min-height: 545px;
}

.section-title {
  margin: 0 0 12px 2px;
  font-size: 15px;
  color: #333;
}

.form-grid {
  display: grid;
  grid-template-columns: 136px minmax(210px, 1fr);
  gap: 10px 12px;
  align-items: center;
}

.form-grid label {
  color: var(--label-red);
  font-weight: bold;
  line-height: 1.1;
}

.form-grid label.optional {
  color: #222;
  font-weight: normal;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 26px;
  border: 1px solid #e3e3e3;
  background: #fff;
  padding: 3px 6px;
}

.form-grid input[readonly] {
  background: #f6f6f6;
  color: #333;
}

.form-grid textarea {
  min-height: 90px;
  resize: vertical;
}

.form-grid .wide-note {
  min-height: 70px;
}

.form-section {
  display: none;
}
.form-section.active {
  display: block;
}

.side-nav {
  align-self: start;
  border: 1px solid var(--line);
}

.side-nav button {
  display: block;
  width: 100%;
  height: 35px;
  text-align: left;
  padding-left: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-weight: bold;
  cursor: pointer;
}
.side-nav button.active {
  background: #f3f7f8;
  outline: 1px solid #7ca4ad;
  color: #444;
}
.side-nav button.placeholder {
  color: #333;
}
.side-nav button:last-child { border-bottom: 0; }

.validation-box {
  margin: 10px 0;
  padding: 9px 12px;
  border: 1px solid #e3c17c;
  background: #fff7e4;
  color: #5c3d00;
  display: none;
}

.lock-banner {
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #b76d6d;
  background: #fff1f1;
  color: #7d1010;
  font-weight: bold;
}

.meta-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #444;
  margin-bottom: 10px;
  font-size: 12px;
}

.placeholder-panel {
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 18px;
  max-width: 900px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 18px;
  max-width: 460px;
  padding: 10px 14px;
  border: 1px solid #9fb0b8;
  background: #ffffff;
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: none;
  z-index: 20;
}

.toast.show { display: block; }

@media (max-width: 800px) {
  .top-bar { height: auto; align-items: flex-start; flex-direction: column; padding: 8px; gap: 6px; }
  .login-strip { flex-wrap: wrap; }
  .form-body { grid-template-columns: 1fr; }
  .side-nav { order: -1; }
  .option-bar { grid-template-columns: 1fr 1fr 1fr; height: auto; }
  .option-title { grid-column: 1 / -1; height: 30px; }
  .option-bar button { height: 32px; }
}

/* Phase 2 expanded spec form additions */
.option-bar.phase2-options {
  grid-template-columns: minmax(180px, 1.25fr) repeat(9, minmax(78px, 1fr));
  height: auto;
  min-height: 36px;
}
.option-bar.phase2-options button { min-height: 36px; padding: 4px 5px; }
.sub-title { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); }
.additional-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.additional-table th {
  text-align: left;
  padding: 5px;
  border: 1px solid var(--line);
  background: #f4f4f4;
  font-size: 12px;
}
.additional-table td {
  padding: 4px;
  border: 1px solid var(--line);
}
.additional-table input {
  width: 100%;
  min-height: 24px;
  border: 1px solid #e3e3e3;
  padding: 3px 5px;
}
.small-row-btn {
  min-height: 24px;
  border: 1px solid #bbb;
  background: #efefef;
  cursor: pointer;
}
.small-row-btn:disabled { color: #aaa; cursor: not-allowed; }
@media (max-width: 960px) {
  .option-bar.phase2-options { grid-template-columns: 1fr 1fr 1fr; }
  .option-bar.phase2-options .option-title { grid-column: 1 / -1; }
}

/* Phase 2 additional items Yes/No assembly list */
.additional-table.yes-no-list th:nth-child(1) { width: 38%; }
.additional-table.yes-no-list th:nth-child(2) { width: 150px; }
.additional-item-name { font-weight: bold; }
.additional-radio-cell { white-space: nowrap; }
.additional-radio-cell label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-weight: normal; color: #222; }
.additional-radio-cell input[type="radio"] { width: auto; min-height: auto; }

/* Phase 3 Quote Builder */
.dashboard-table tr.selected-row td {
  background: #e8f2f5;
  outline: 1px solid #8ab4bf;
}
.quote-shell,
.quote-builder {
  max-width: 1360px;
  margin: 0 auto;
}
.quote-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}
.quote-title-row h2 { margin: 0 0 2px; font-size: 18px; }
.quote-lines-wrap,
.quote-list-wrap {
  overflow-x: auto;
}
.quote-lines {
  width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
  table-layout: fixed;
}
.quote-lines th {
  text-align: left;
  padding: 5px;
  border: 1px solid var(--line);
  background: #f4f4f4;
  font-size: 12px;
}
.quote-lines td {
  padding: 4px;
  border: 1px solid var(--line);
  vertical-align: middle;
  font-size: 12px;
}
.quote-lines input {
  width: 100%;
  min-height: 24px;
  border: 1px solid #e1e1e1;
  padding: 2px 4px;
}
.quote-lines input[type="checkbox"] {
  width: auto;
  min-height: auto;
}
.quote-lines th:nth-child(1) { width: 52px; }
.quote-lines th:nth-child(2) { width: 78px; }
.quote-lines th:nth-child(3) { width: 150px; }
.quote-lines th:nth-child(4) { width: 150px; }
.quote-lines th:nth-child(5) { width: 290px; }
.quote-lines th:nth-child(6) { width: 78px; }
.quote-lines th:nth-child(7) { width: 70px; }
.quote-lines th:nth-child(8) { width: 82px; }
.quote-lines th:nth-child(9) { width: 72px; }
.quote-lines th:nth-child(10) { width: 95px; }
.quote-lines th:nth-child(11) { width: 110px; }
.quote-lines th:nth-child(12) { width: 78px; }
.quote-lines th:nth-child(13) { width: 210px; }
.quote-lines th:nth-child(14) { width: 68px; }
.quote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8f8f8;
}
.quote-list-table { min-width: 1120px; }
@media (max-width: 1000px) {
  .quote-grid { grid-template-columns: 140px 1fr; }
  .quote-row-panels { grid-template-columns: 1fr; }
  .inline-controls { grid-template-columns: 1fr; }
}

/* Phase 3 resource rebuild - estimate dashboard visual alignment */
.estimate-dashboard {
  max-width: none;
  margin: -10px -14px -30px -20px;
  background: #e9f0f5;
  min-height: calc(100vh - 86px);
  border-top: 1px solid #9faeb8;
}
.estimate-ribbon {
  height: 92px;
  display: flex;
  align-items: flex-start;
  gap: 3px;
  padding: 0 0 0 0;
  border-bottom: 1px solid #aab6bf;
  background: linear-gradient(#eef4f8, #d7e1e8);
}
.estimate-ribbon button {
  min-width: 72px;
  min-height: 78px;
  border: 0;
  border-right: 1px solid #b5c0c8;
  background: transparent;
  color: #0c2c45;
  cursor: pointer;
  font-weight: bold;
  padding-top: 30px;
}
.estimate-ribbon button:hover { background: rgba(255,255,255,.55); }
.estimate-ribbon span { font-size: 11px; font-weight: normal; }
.estimate-number-bar {
  height: 30px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: #0a8f36;
  font-size: 18px;
  background: #eef4f8;
  border-bottom: 1px solid #b7c2cb;
}
.estimate-section-title {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 4px 12px;
  border-top: 1px solid #a5b3be;
  border-bottom: 1px solid #a5b3be;
  background: #fff;
  font-weight: bold;
  color: #111;
}
.estimate-section-title::before {
  content: "▲";
  font-size: 9px;
  margin-right: 6px;
}
.estimate-header-layout {
  display: grid;
  grid-template-columns: 330px 330px 260px 260px;
  gap: 18px;
  align-items: start;
  padding: 8px 28px 10px;
  background: #fff;
  min-width: 1220px;
}
.estimate-col h4 {
  margin: 0 0 7px;
  color: #111;
}
.estimate-col {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 5px 8px;
  align-items: start;
}
.estimate-col h4 { grid-column: 1 / -1; }
.estimate-col label {
  color: #111;
  font-weight: normal;
  font-size: 12px;
  padding-top: 5px;
}
.estimate-col input,
.estimate-col select,
.estimate-col textarea {
  width: 100%;
  min-height: 23px;
  border: 1px solid #d3d7dc;
  background: #fff;
  padding: 2px 5px;
  font-size: 12px;
}
.estimate-col textarea {
  min-height: 72px;
  resize: vertical;
}
.estimate-col input[readonly],
.estimate-col textarea[readonly] {
  background: #f4f4f4;
  color: #333;
}
.estimate-lines-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 4px 28px;
  background: #e8f1f7;
  border-bottom: 1px solid #b8c8d2;
}
.estimate-lines-toolbar button,
.estimate-lines-toolbar select {
  min-height: 24px;
  border: 1px solid #b9c4cc;
  border-radius: 6px;
  background: #fff;
  color: #203943;
  padding: 2px 8px;
  transition: background .15s ease, border-color .15s ease;
}
.estimate-lines-toolbar button:hover:not(:disabled) {
  border-color: #759daa;
  background: #f4f8fa;
}
.estimate-lines-toolbar button:disabled {
  color: #9aa5a9;
  background: #edf1f2;
  border-color: #d3dcdf;
  cursor: not-allowed;
}
.estimate-lines-toolbar select { min-width: 290px; }
.estimate-lines {
  min-width: 1120px;
  background: #fff;
}
.estimate-lines th {
  background: #f9fbfc;
  border-color: #d5e1e9;
  font-size: 12px;
  color: #111;
}
.estimate-lines td {
  border-color: #d8e3eb;
  background: #fff;
}
.estimate-lines tbody tr:nth-child(even) td { background: #f7fbff; }
.estimate-lines th:nth-child(1) { width: 34px; }
.estimate-lines th:nth-child(2) { width: 150px; }
.estimate-lines th:nth-child(3) { width: 190px; }
.estimate-lines th:nth-child(4) { width: 380px; }
.estimate-lines th:nth-child(5) { width: 100px; }
.estimate-lines th:nth-child(6) { width: 95px; }
.estimate-lines th:nth-child(7) { width: 95px; }
.estimate-lines th:nth-child(8) { width: 160px; }
.estimate-lines th:nth-child(9) { width: 75px; }
.estimate-lines th:nth-child(10) { width: 180px; }
.estimate-lines th:nth-child(11) { width: 70px; }
.estimate-total-box {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-right: auto;
  color: #111;
}

.field-radio-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 31px;
  padding: 6px 8px;
  border: 1px solid #c7d0dd;
  background: #fff;
}
.field-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  color: #222;
  margin: 0;
}
.field-radio-group input[type="radio"] {
  width: auto;
  min-height: auto;
}

/* Phase 4 lifecycle hardening */
.status-badge{display:inline-block;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.2;background:#eef2f7;color:#253244;border:1px solid #d4dbe7;white-space:nowrap}
.status-needs-sales-revision{background:#fff2d7;color:#7a4b00;border-color:#f2c46d}
.status-spec-completion-needed{background:#e8f3ff;color:#164a7a;border-color:#a7cdf4}
.status-submitted-for-final-review,.status-engineering-review{background:#ede7ff;color:#462b86;border-color:#c8b8ff}
.status-finalized{background:#e8f7ed;color:#176033;border-color:#9ed6b2}
.status-released-to-order-entry{background:#e4f7f4;color:#075b54;border-color:#91d4cb}
.status-cancelled-lost{background:#fde8e8;color:#8b1a1a;border-color:#f2a5a5}
.validation-section{margin-top:8px}.validation-section ul{margin:4px 0 0 22px;padding:0}.validation-section li{margin:2px 0}

/* Phase 4.1 centralized required-field validation UX */
.required-missing-field{border:2px solid #d97706!important;background:#fff7ed!important;box-shadow:0 0 0 3px rgba(217,119,6,.12)!important}
.required-missing-group{border:2px solid #d97706!important;background:#fff7ed!important;border-radius:10px;padding:8px;box-shadow:0 0 0 3px rgba(217,119,6,.12)!important}
.required-missing-label{color:#9a3412!important;font-weight:700!important}
.required-inline-message{font-size:12px;margin:-4px 0 8px 0;grid-column:auto;color:#9a3412!important}
.required-section-incomplete{border-left:4px solid #d97706!important;background:#fff7ed!important}
.required-section-complete{border-left:4px solid #16a34a!important}
.nav-section-label{display:block;font-weight:700}.nav-required-status{display:block;font-size:11px;opacity:.85;margin-top:3px;line-height:1.15}.required-section-incomplete .nav-required-status{color:#9a3412;font-weight:700}.required-section-complete .nav-required-status{color:#166534}
.validation-summary-head{display:flex;gap:12px;align-items:center;justify-content:space-between}.validation-summary-head .small{padding:6px 10px;font-size:12px}.validation-section-link{background:transparent;border:0;padding:0;color:inherit;cursor:pointer;text-align:left}.validation-section-link:hover{text-decoration:underline}.validation-box p{margin:8px 0}.validation-section ul{columns:1}
@keyframes requiredPulse{0%{box-shadow:0 0 0 0 rgba(217,119,6,.55)}70%{box-shadow:0 0 0 10px rgba(217,119,6,0)}100%{box-shadow:0 0 0 0 rgba(217,119,6,0)}}
.required-field-pulse{animation:requiredPulse 1.4s ease-out 1!important}

/* Phase 4.2.2: missing-field indicators must not alter form-grid layout */
.required-missing-field{border-color:#d97706!important;outline:2px solid #d97706!important;outline-offset:-2px!important;background:#fffaf0!important;box-shadow:0 0 0 3px rgba(217,119,6,.10)!important}
.required-missing-group{outline:2px solid #d97706!important;outline-offset:-2px!important;background:#fffaf0!important;border-color:#d97706!important;border-radius:8px!important;padding:0!important;box-shadow:0 0 0 3px rgba(217,119,6,.10)!important}
.required-missing-label::after{content:"  Missing";font-size:11px;font-weight:700;color:#9a3412;background:#ffedd5;border:1px solid #fdba74;border-radius:999px;padding:1px 6px;margin-left:6px;white-space:nowrap}
.required-inline-message{display:none!important}

/* Phase 4.2.3: PO validation is field-border only */
.required-missing-field{border:3px solid #dc2626!important;outline:none!important;background:#fff!important;box-shadow:none!important}
.required-missing-group{border:3px solid #dc2626!important;outline:none!important;background:#fff!important;box-shadow:none!important;padding:0!important}
.required-missing-label{color:inherit!important;font-weight:inherit!important}
.required-missing-label::after{content:none!important;display:none!important}
.required-inline-message{display:none!important}

/* Phase 4.2.4: compact validation summary, no long missing-field list */
.validation-section-chip-wrap{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.validation-section-chip{border:1px solid #d6a642;background:#fff7df;color:#5f3b00;border-radius:999px;padding:4px 9px;font-size:12px;cursor:pointer}.validation-section-chip:hover{background:#ffe9b0}.validation-box ul{display:none!important}

/* Phase 4.2.5: PO Received uses right-menu counts and red field outlines only */
.validation-box:empty{display:none!important}

/* Phase 4.2.8 User Management Dashboard */
.admin-tab[hidden] { display: none !important; }
.user-management-panel { max-width: 1280px; margin: 0 auto; }
.user-admin-toolbar { align-items: flex-start; }
.user-management-table th:nth-child(1) { width: 165px; }
.user-management-table th:nth-child(2) { width: 180px; }
/* Actions column holds "Edit" + "Reset Password" side by side (~205px of buttons).
   .dashboard-table is table-layout:fixed with overflow:hidden cells, so a column that is
   too narrow silently CLIPS its contents instead of growing — at the old 160px the Reset
   Password button overflowed by 42px and was invisible and unclickable from the day it
   shipped. white-space:normal is the safety net: if the buttons ever outgrow the column
   again they wrap to a second line (rows are auto-height) rather than disappearing. */
.user-management-table th:nth-child(6) { width: 230px; }
.user-management-table .actions-cell { white-space: normal; }
.user-management-table .actions-cell .action-btn { margin: 2px 4px 2px 0; }
.user-management-table input,
.user-management-table select { width: 100%; box-sizing: border-box; padding: 7px 8px; border: 1px solid #c9d2dc; border-radius: 6px; background: #fff; }
.user-management-table .status-cell { min-width: 165px; }
.user-management-table .status-cell label { display: block; font-size: 12px; margin: 2px 0; white-space: nowrap; }
.user-management-table .status-cell input { width: auto; margin-right: 6px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid #c9d2dc; padding: 3px 9px; font-weight: 700; font-size: 12px; }
.status-pill.active { background: #eaf7ec; color: #166534; border-color: #b7e2bf; }
.status-pill.inactive { background: #f4f4f5; color: #52525b; border-color: #d4d4d8; }

/* A user who used "Forgot password?" and is waiting on an admin to issue a temp password.
   Sits in the Status cell on its own line — block, so a long email can never push it out
   of a fixed-width cell and get it clipped the way the Reset Password button was. */
.reset-requested-badge { display: block; width: fit-content; margin-top: 5px; border-radius: 999px;
  border: 1px solid #e2c58a; background: #fdf5e3; color: var(--warn); padding: 2px 8px; font-weight: 700; font-size: 11px; white-space: nowrap; }
.reset-requested-row > td { background: #fffcf4; }
.inactive-user td { color: #667085; background: #fafafa; }
.actions-cell { white-space: nowrap; }
.invalid-field { border: 2px solid #c62828 !important; background: #fff8f8 !important; }

/* One-time temporary-password banner (admin add-user / reset-password). */
.temp-pw-banner { position: fixed; right: 20px; bottom: 20px; max-width: 360px; z-index: 1000;
  background: #fff; border: 1px solid var(--teal); border-radius: 10px; padding: 16px 18px;
  box-shadow: 0 8px 28px rgba(38,63,73,.18); }
.temp-pw-banner h4 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.temp-pw-banner .temp-pw-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.temp-pw-banner .temp-pw-row span { font-size: 12px; color: var(--muted); }
.temp-pw-banner code { font-size: 14px; font-weight: 700; background: var(--light-gray); padding: 4px 8px; border-radius: 6px; }
.temp-pw-banner p { margin: 8px 0 10px; font-size: 12px; color: var(--muted); }

/* Phase 7 visual housekeeping - scoped dashboard/spec shell polish */
.tab-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: auto;
  min-height: 50px;
  padding: 10px 18px;
  background: #eef3f5;
  border-bottom: 1px solid #cbd9de;
  overflow-x: auto;
}
.tab {
  flex: 0 0 auto;
  min-width: 185px;
  border: 1px solid #c4d0d5;
  border-radius: 12px;
  background: #fff;
  color: #243f49;
  padding: 10px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  text-align: center;
}
.tab:hover:not(:disabled) {
  background: #f8fbfc;
  border-color: #8eb0bb;
  transform: translateY(-1px);
}
.tab.active {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #fff;
  box-shadow: 0 3px 8px rgba(4,123,158,.22);
}
.tab.admin-tab {
  margin-left: 0;
}

.dashboard-shell {
  max-width: 1460px;
  margin: 0 auto;
}
.dashboard-header-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  grid-template-areas:
    "admin primary"
    "title primary";
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d5e0e4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
  box-shadow: 0 2px 10px rgba(38,63,73,.08);
}
.dashboard-header-actions {
  grid-area: admin;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.dashboard-title-block {
  grid-area: title;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.dashboard-title-block strong {
  font-size: 18px;
  color: #223b45;
}
.dashboard-primary-nav {
  grid-area: primary;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
}
.dashboard-admin-button,
.dashboard-primary-card {
  border: 1px solid #b9c8cd;
  border-radius: 10px;
  background: #fff;
  color: #203943;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.dashboard-admin-button {
  min-height: 32px;
  padding: 7px 12px;
  font-weight: bold;
}
.dashboard-admin-button.primary {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #fff;
}
.dashboard-admin-button:disabled {
  cursor: not-allowed;
  color: #8d9aa0;
  background: #eef1f2;
  border-color: #d4dcdf;
  box-shadow: none;
}
.dashboard-admin-button:hover:not(:disabled),
.dashboard-primary-card:hover:not(:disabled) {
  border-color: #759daa;
  box-shadow: 0 4px 12px rgba(38,63,73,.12);
  transform: translateY(-1px);
}
.dashboard-primary-card {
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 13px 18px;
  text-align: left;
}
.dashboard-primary-card strong {
  font-size: 15px;
}
.dashboard-primary-card span {
  color: #66777e;
  font-size: 12px;
}

.spec-workflow-shell {
  border: 1px solid #d1dde2;
  border-radius: 14px;
  background: #f8fbfc;
  box-shadow: 0 2px 10px rgba(38,63,73,.08);
  margin-bottom: 12px;
  overflow: hidden;
}
.spec-workflow-title {
  padding: 12px 16px 6px;
  font-weight: bold;
  color: #263f49;
  letter-spacing: .2px;
}
.spec-progress-bar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 10px 14px 12px;
}
.spec-progress-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 130px;
  min-height: 42px;
  padding: 8px 16px 8px 14px;
  border: 1px solid #c2d2d8;
  border-right: 0;
  background: #edf2f4;
  color: #566970;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.spec-progress-step:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}
.spec-progress-step:last-child {
  border-right: 1px solid #c2d2d8;
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}
button.spec-progress-step {
  cursor: pointer;
}
button.spec-progress-step:disabled {
  cursor: not-allowed;
}
.spec-progress-step .step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: rgba(255,255,255,.75);
  flex: 0 0 24px;
  font-size: 12px;
}
.spec-progress-step.is-complete {
  background: #dcebe6;
  color: #1f674e;
  border-color: #aecdc1;
}
.spec-progress-step.is-current {
  background: #263f49;
  color: #fff;
  border-color: #263f49;
  box-shadow: inset 0 -3px 0 rgba(255,255,255,.08);
}
.spec-progress-step.is-future {
  /* Distinguished from is-complete/is-current by background/border color alone (see base
     rule + those two classes) rather than opacity - opacity here was dropping the
     composited text contrast below WCAG AA once layered over the page background. */
}
.spec-progress-step.is-actionable:not(:disabled):hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal-dark);
}
.spec-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid #e1e8eb;
  background: #fff;
}
.spec-action-button {
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid #b8c7cc;
  border-radius: 10px;
  background: #fff;
  color: #203943;
  font-weight: bold;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.spec-action-button.primary {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #fff;
}
.spec-action-button:hover:not(:disabled) {
  border-color: #759daa;
  box-shadow: 0 3px 10px rgba(38,63,73,.12);
  transform: translateY(-1px);
}
.spec-action-button:disabled {
  cursor: not-allowed;
  color: #9aa5a9;
  background: #edf1f2;
  border-color: #d3dcdf;
  box-shadow: none;
}
.side-nav {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(38,63,73,.08);
}
.side-nav button {
  min-height: 38px;
  height: auto;
  padding: 9px 12px 9px 14px;
}
.side-nav button.active {
  background: #eaf4f7;
  outline: none;
  border-left: 4px solid var(--teal);
  padding-left: 10px;
}
.nav-section-label {
  display: block;
}
.nav-required-status {
  display: block;
  margin-top: 2px;
  color: #64767d;
  font-size: 11px;
  font-weight: normal;
}

@media (max-width: 960px) {
  .dashboard-header-panel {
    grid-template-columns: 1fr;
    grid-template-areas: "admin" "title" "primary";
  }
  .dashboard-primary-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .spec-progress-step {
    min-width: 118px;
  }
}

@media print {
  .tab-bar,
  .dashboard-header-panel,
  .spec-workflow-shell {
    display: none !important;
  }
}

/* Phase 7.1 placement cleanup */
.login-strip {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}
.login-strip .top-admin-btn.tab.admin-tab {
  flex: 0 0 auto;
  min-width: 145px;
  min-height: 28px;
  height: 28px;
  padding: 4px 12px;
  border: 1px solid #b8c7cc;
  border-radius: 6px;
  background: #f7f7f7;
  color: #111;
  box-shadow: none;
  font-weight: bold;
  transform: none;
}
.login-strip .top-admin-btn.tab.admin-tab:hover:not(:disabled) {
  background: #fff;
  border-color: #d7e3e7;
  box-shadow: none;
  transform: none;
}
.login-strip .top-admin-btn.tab.admin-tab.active {
  background: #eaf4f7;
  border-color: #8eb0bb;
  color: #15313b;
}

.spec-status-movement {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding-left: 12px;
}
.spec-status-movement label {
  color: #334a54;
  font-weight: bold;
  white-space: nowrap;
}
.spec-status-movement select {
  min-width: 180px;
  height: 34px;
  border: 1px solid #b8c7cc;
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
}
.spec-action-button.compact {
  min-height: 34px;
  padding: 6px 12px;
}
@media (max-width: 1120px) {
  .spec-status-movement {
    margin-left: 0;
    width: 100%;
    padding-left: 0;
  }
}

/* Phase 7.2 dashboard table fit cleanup */
.dashboard-shell .dashboard-table-wrap {
  overflow-x: hidden;
}
.dashboard-shell .dashboard-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.dashboard-shell .dashboard-table th,
.dashboard-shell .dashboard-table td {
  padding-left: 4px;
  padding-right: 4px;
}
.dashboard-shell .dashboard-table .filters input {
  min-width: 0;
}
