/* ============================================================
   NTPF Pathway Manager — component styles
   Built entirely on the shared PrecisionSight design tokens
   (--accent teal, General Sans, shadows, radii) defined in styles.css.
   ============================================================ */

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

/* ---- Top bar ------------------------------------------------ */
.nt-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.nt-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  flex: none;
  box-shadow: var(--shadow-1);
}
.nt-brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.nt-brand-sub {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.1;
}
.nt-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nt-user {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---- Layout ------------------------------------------------- */
.nt-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}
.nt-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.nt-toolbar h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
}
.nt-toolbar .nt-spacer { flex: 1; }
.nt-seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.nt-seg button {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all var(--t-fast) var(--ease);
}
.nt-seg button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ---- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-input);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-1);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--error); border-color: color-mix(in srgb, var(--error) 35%, var(--border)); }
.btn-danger:hover { background: var(--error-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---- Inputs ------------------------------------------------- */
.nt-field { display: flex; flex-direction: column; gap: 6px; }
.nt-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}
.nt-input,
.nt-select,
.nt-textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.nt-textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.nt-input:focus,
.nt-select:focus,
.nt-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.nt-search { position: relative; min-width: 220px; }
.nt-search .nt-input { padding-left: 34px; }
.nt-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }

/* ---- Cards -------------------------------------------------- */
.nt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
}
.nt-card-pad { padding: 18px; }

/* ---- Needs-action banner ----------------------------------- */
.nt-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.nt-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border));
  font-size: 13px;
  cursor: pointer;
}
.nt-alert .nt-alert-days { margin-left: auto; color: var(--warning); font-weight: 600; }

/* ---- Stage badges ------------------------------------------ */
.nt-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.nt-stage .nt-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.nt-stage.s1 { background: hsl(210 60% 94%); color: hsl(210 70% 38%); }
.nt-stage.s2 { background: hsl(265 50% 94%); color: hsl(265 50% 48%); }
.nt-stage.s3 { background: hsl(35 70% 92%); color: var(--warning); }
.nt-stage.s4 { background: var(--success-soft); color: var(--success); }
.nt-stage.s5 { background: var(--error-soft); color: var(--error); }

.nt-eye {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

/* ---- Table -------------------------------------------------- */
.nt-table-wrap { overflow-x: auto; }
.nt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.nt-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
}
.nt-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.nt-table tbody tr { cursor: pointer; transition: background var(--t-fast) var(--ease); }
.nt-table tbody tr:hover { background: var(--surface-2); }
.nt-table .nt-name { font-weight: 500; }
.nt-table .nt-sub { color: var(--ink-faint); font-size: 12px; }

/* ---- Kanban board ------------------------------------------ */
.nt-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(248px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.nt-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px;
  min-height: 120px;
}
.nt-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 10px;
}
.nt-col-head .nt-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
.nt-pcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 9px;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.nt-pcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.nt-pcard .nt-name { font-weight: 500; font-size: 13.5px; }
.nt-pcard .nt-meta { display: flex; gap: 8px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.nt-pcard .nt-sub { color: var(--ink-faint); font-size: 12px; }

/* ---- Empty state ------------------------------------------- */
.nt-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--ink-muted);
}
.nt-empty svg { color: var(--ink-faint); margin-bottom: 12px; }
.nt-empty h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 6px; color: var(--ink); }

/* ---- Drawer / modal ---------------------------------------- */
.nt-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: hsl(200 25% 10% / 0.34);
  backdrop-filter: blur(2px);
  opacity: 0;
  animation: nt-fade var(--t-med) var(--ease) forwards;
}
@keyframes nt-fade { to { opacity: 1; } }
.nt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(520px, 100vw);
  background: var(--canvas);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  animation: nt-slide var(--t-med) var(--ease) forwards;
}
@keyframes nt-slide { to { transform: translateX(0); } }
.nt-drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.nt-drawer-title { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.nt-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.nt-section-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.nt-kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 12px; font-size: 13.5px; }
.nt-kv dt { color: var(--ink-muted); }
.nt-kv dd { margin: 0; }
.nt-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.nt-eye-pick { display: flex; gap: 8px; }
.nt-eye-pick .btn { flex: 1; }
.nt-eye-pick .btn.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Timeline ---------------------------------------------- */
.nt-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.nt-tl { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.nt-tl::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.nt-tl:last-child::before { display: none; }
.nt-tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 3px; z-index: 1; }
.nt-tl-body { font-size: 13px; }
.nt-tl-meta { color: var(--ink-faint); font-size: 11.5px; margin-top: 2px; }

/* ---- Docs list --------------------------------------------- */
.nt-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  margin-bottom: 7px;
  font-size: 13px;
}
.nt-doc a { margin-left: auto; color: var(--accent); font-weight: 500; }

/* ---- Dropzone (upload) ------------------------------------- */
.nt-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-card);
  padding: 40px 24px;
  text-align: center;
  background: var(--surface-2);
  transition: all var(--t-fast) var(--ease);
  cursor: pointer;
}
.nt-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.nt-drop svg { color: var(--accent); margin-bottom: 12px; }
.nt-drop h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 4px; }
.nt-drop p { color: var(--ink-muted); margin: 0; font-size: 13px; }
.nt-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nt-review-grid .nt-col-span { grid-column: 1 / -1; }
.nt-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-input);
  font-size: 13px; margin-bottom: 14px;
}
.nt-banner.warn { background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border)); }

/* ---- Toasts ------------------------------------------------- */
#toast-region {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.nt-toast {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--canvas);
  font-size: 13px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(8px);
  animation: nt-toast-in var(--t-med) var(--ease) forwards;
}
.nt-toast.err { background: var(--error); color: #fff; }
.nt-toast.ok { background: var(--success); color: #fff; }
@keyframes nt-toast-in { to { opacity: 1; transform: translateY(0); } }

/* ---- Spinner ------------------------------------------------ */
.nt-spin {
  width: 18px; height: 18px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: nt-rot 0.7s linear infinite;
}
@keyframes nt-rot { to { transform: rotate(360deg); } }
.nt-center { display: grid; place-items: center; padding: 80px; color: var(--ink-muted); }

/* ---- Responsive -------------------------------------------- */
@media (max-width: 760px) {
  .nt-main { padding: 16px; }
  .nt-review-grid,
  .nt-actions-grid { grid-template-columns: 1fr; }
  .nt-kv { grid-template-columns: 96px 1fr; }
  .nt-brand-sub { display: none; }
}
