:root {
  --pro-blue: #1c5ea8;
  --midnight: #081a47;
  --green: #0e7c0e;
  --blue: #1c5ea8;
  --red: #c62828;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  font-family:
    system-ui,
    Segoe UI,
    Arial,
    sans-serif;
  background: #f7fafc;
  margin: 0;
  color: #0b1220;
}

/* Header & nav */
.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
}
.logo {
  height: 42px;
}
.titles h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--midnight);
}
.subtitle {
  margin: 0;
  color: #5b6b84;
}
.nav {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.nav-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  text-decoration: none;
  color: #0b1220;
  border: 1px solid #d1d9e6;
  background: #fff;
}
.nav-link.active {
  background: var(--pro-blue);
  color: #fff;
  border-color: var(--pro-blue);
}

/* Layout & cards */
main {
  padding-bottom: 2rem;
}
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 1rem;
}

/* Controls row */
.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: end;
}
@media (max-width: 900px) {
  .controls {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}
@media (max-width: 520px) {
  .controls {
    grid-template-columns: repeat(1, minmax(180px, 1fr));
  }
}
.controls label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
/* FIX: was .controls&gt;div */
.controls > div {
  display: flex;
  flex-direction: column;
}
.controls .actions {
  grid-column: 1 / span 2;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

/* Inputs (unified look for selects + search input) */
.controls select,
.controls input[type="search"].selectlike {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0b122a;
  font: inherit;
  line-height: 1.25;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Keep the original button styles */
button {
  background: var(--pro-blue);
  color: #fff;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.45rem 0.7rem;
}
button.secondary {
  background: #fff;
  color: #0b1220;
  border-color: #cbd5e1;
}
button.sm {
  font-size: 0.85rem;
  padding: 0.35rem 0.55rem;
}

/* Focus ring to match selects */
.controls select:focus,
.controls input[type="search"].selectlike:focus {
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15);
}

/* Placeholder for search */
.controls input[type="search"].selectlike::placeholder {
  color: #94a3b8;
}

/* Remove native WebKit search decorations for a cleaner look */
.controls input[type="search"].selectlike::-webkit-search-decoration,
.controls input[type="search"].selectlike::-webkit-search-cancel-button,
.controls input[type="search"].selectlike::-webkit-search-results-button,
.controls input[type="search"].selectlike::-webkit-search-results-decoration {
  display: none;
}

/* Disabled state (selects + selectlike search) */
.controls select:disabled,
.controls input[type="search"].selectlike:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* Optional: dim labels when the adjacent field is disabled (supported in modern browsers) */
.controls label:has(+ select:disabled),
.controls label:has(+ input[type="search"].selectlike:disabled) {
  opacity: 0.6;
}

/* Result chips & badges */
.result-chip {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
}
.result-chip.approved {
  background: var(--green);
}
.result-chip.experienced {
  background: var(--blue);
}
.result-chip.notapproved {
  background: var(--red);
}

.legend {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.25rem 1rem;
}
.legend .status-badge {
  font-size: 0.75rem;
}

/* Tables */
.scroller {
  overflow: auto;
  max-height: 60vh;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.table th,
.table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

/* Status badges (compact) */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  text-transform: uppercase;
}
.status-badge.approved {
  background: #0e7c0e;
}
.status-badge.experienced {
  background: #1c5ea8;
}
.status-badge.notapproved {
  background: #c62828;
}

/* Mapping grid */
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}
.mapping-grid .col {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 0.5rem;
  padding: 0.5rem;
}
.mapping-grid .col h4 {
  margin: 0.1rem 0 0.5rem 0;
  color: #081a47;
  font-size: 1rem;
}
.mapping-grid .mini-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.mapping-grid .mini-table td {
  padding: 0.35rem 0.45rem;
  border: 1px solid #cfd8e3;
  font-size: 0.92rem;
}
.mapping-grid .mini-table tr td:first-child {
  min-width: 120px;
}

/* Footer & helpers */
.footer {
  padding: 1rem;
  text-align: center;
  color: #5b6b84;
}
.note {
  margin: 0 1rem 0.5rem 1rem;
  color: #5b6b84;
  font-size: 0.85rem;
}
.hidden {
  display: none;
}

/* ================================
   New Training Product (NTP) styles
   Append to existing stylesheet
   ================================ */

/* Theme tokens (scoped so they won’t collide) */
.ntp {
  --fg: #1f2328;
  --muted: #57606a;
  --ok: #0b6;
  --warn: #d9822b;
  --err: #d42;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --line: #d0d7de;
  --chip: #e7f3ff;
}

/* Basic layout */
.ntp body,
.ntp {
  color: var(--fg);
  background: var(--bg);
}

.ntp header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ntp h1 {
  margin: 0;
  font-size: 18px;
}

.ntp main {
  padding: 16px 20px;
  display: grid;
  gap: 16px;
}

/* Utility grids */
.ntp .grid {
  display: grid;
  gap: 16px;
}

.ntp .cols {
  display: grid;
  gap: 16px;
  grid-template-columns: 320px 1fr;
}

/* Cards / containers */
.ntp .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

/* Flex rows */
.ntp .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

/* Form bits */
.ntp label {
  display: block;
  margin: 4px 0;
  font-size: 12px;
  color: var(--muted);
}

.ntp select,
.ntp input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  color: inherit;
}

/* Buttons */
.ntp .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ntp .btn.primary {
  background: var(--ok);
  color: #fff;
  border-color: #0a5;
}

.ntp .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Micro text + statuses */
.ntp .tiny {
  font-size: 12px;
  color: var(--muted);
}
.ntp .ok {
  color: var(--ok);
}
.ntp .warn {
  color: var(--warn);
}
.ntp .err {
  color: var(--err);
}

/* Summary pills */
.ntp .pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

.ntp .counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ntp .counts > .pill strong {
  min-width: 20px;
  display: inline-block;
  text-align: right;
}

/* Table */
.ntp table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ntp th,
.ntp td {
  border-top: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.ntp th {
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 0;
}

.ntp .unit-row {
  cursor: pointer;
}

/* Chips / tags */
.ntp .chip {
  display: inline-block;
  background: var(--chip);
  border: 1px solid #b6dafc;
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 6px;
  font-size: 12px;
}

/* Alignment helpers */
.ntp .right {
  float: right;
}
.ntp .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Rule severity coloring (for textual validation) */
.ntp .rule-ok {
  color: var(--ok);
}
.ntp .rule-warn {
  color: var(--warn);
}
.ntp .rule-err {
  color: var(--err);
}

/* Scroll areas */
.ntp .scroll-y {
  overflow: auto;
  max-height: 60vh;
}

/* Focus styles (accessibility) */
.ntp select:focus,
.ntp input[type="text"]:focus,
.ntp .btn:focus {
  outline: 3px solid rgba(13, 110, 253, 0.35);
  outline-offset: 1px;
}

/* Hover highlight for unit rows */
.ntp .unit-row:hover td {
  background: #fff;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
  .ntp .cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ntp header {
    padding: 12px 14px;
  }
  .ntp main {
    padding: 12px 14px;
    gap: 12px;
  }
  .ntp .card {
    padding: 10px;
  }
  .ntp .counts {
    gap: 6px;
  }
  .ntp .pill {
    font-size: 11px;
    padding: 3px 7px;
  }
  .ntp table {
    font-size: 12.5px;
  }
  .ntp th,
  .ntp td {
    padding: 6px 5px;
  }
}

/* Optional: reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .ntp * {
    transition: none !important;
  }
}

/* ================================
   New Training Product (NTP) styles
   Append to existing stylesheet
   ================================ */

/* Theme tokens (scoped so they won’t collide) */
.ntp {
  --fg: #1f2328;
  --muted: #57606a;
  --ok: #0b6;
  --warn: #d9822b;
  --err: #d42;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --line: #d0d7de;
  --chip: #e7f3ff;
}

/* Basic layout */
.ntp body,
.ntp {
  color: var(--fg);
  background: var(--bg);
}

.ntp header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ntp h1 {
  margin: 0;
  font-size: 18px;
}

.ntp main {
  padding: 16px 20px;
  display: grid;
  gap: 16px;
}

/* Utility grids */
.ntp .grid {
  display: grid;
  gap: 16px;
}

.ntp .cols {
  display: grid;
  gap: 16px;
  grid-template-columns: 320px 1fr;
}

/* Cards / containers */
.ntp .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

/* Flex rows */
.ntp .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

/* Form bits */
.ntp label {
  display: block;
  margin: 4px 0;
  font-size: 12px;
  color: var(--muted);
}

.ntp select,
.ntp input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  color: inherit;
}

/* Buttons */
.ntp .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ntp .btn.primary {
  background: var(--ok);
  color: #fff;
  border-color: #0a5;
}

.ntp .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Micro text + statuses */
.ntp .tiny {
  font-size: 12px;
  color: var(--muted);
}
.ntp .ok {
  color: var(--ok);
}
.ntp .warn {
  color: var(--warn);
}
.ntp .err {
  color: var(--err);
}

/* Summary pills */
.ntp .pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

.ntp .counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ntp .counts > .pill strong {
  min-width: 20px;
  display: inline-block;
  text-align: right;
}

/* Table */
.ntp table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ntp th,
.ntp td {
  border-top: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.ntp th {
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 0;
}

.ntp .unit-row {
  cursor: pointer;
}

/* Chips / tags */
.ntp .chip {
  display: inline-block;
  background: var(--chip);
  border: 1px solid #b6dafc;
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 6px;
  font-size: 12px;
}

/* Alignment helpers */
.ntp .right {
  float: right;
}
.ntp .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Rule severity coloring (for textual validation) */
.ntp .rule-ok {
  color: var(--ok);
}
.ntp .rule-warn {
  color: var(--warn);
}
.ntp .rule-err {
  color: var(--err);
}

/* Scroll areas */
.ntp .scroll-y {
  overflow: auto;
  max-height: 60vh;
}

/* Focus styles (accessibility) */
.ntp select:focus,
.ntp input[type="text"]:focus,
.ntp .btn:focus {
  outline: 3px solid rgba(13, 110, 253, 0.35);
  outline-offset: 1px;
}

/* Hover highlight for unit rows */
.ntp .unit-row:hover td {
  background: #fff;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
  .ntp .cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ntp header {
    padding: 12px 14px;
  }
  .ntp main {
    padding: 12px 14px;
    gap: 12px;
  }
  .ntp .card {
    padding: 10px;
  }
  .ntp .counts {
    gap: 6px;
  }
  .ntp .pill {
    font-size: 11px;
    padding: 3px 7px;
  }
  .ntp table {
    font-size: 12.5px;
  }
  .ntp th,
  .ntp td {
    padding: 6px 5px;
  }
}

/* Optional: reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .ntp * {
    transition: none !important;
  }
}
