/* NALQIVO ERP — Tenders workspace.
   Theme-aware: --nq-* only. No layout-shifting #view > * animation. */

.nq-td { color: var(--nq-ink); min-width: 0; }

.nq-td-pagehead {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 4px;
}
.nq-td-pagehead h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--nq-ink-strong, var(--nq-ink));
}
.nq-td-pagehead p {
  margin: 4px 0 0;
  color: var(--nq-muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 52rem;
}
.nq-td-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- KPI cards -------------------------------------------------------- */
.nq-td-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.nq-td-kpi {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 13px;
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface) 94%, transparent);
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.nq-td-kpi:hover { border-color: var(--nq-primary-300); }
.nq-td-kpi-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--nq-primary-50);
  color: var(--nq-primary-700);
}
.nq-td-kpi.tone-open .nq-td-kpi-icon { background: var(--nq-info-soft, var(--nq-primary-50)); color: var(--nq-info, var(--nq-primary-700)); }
.nq-td-kpi.tone-soon .nq-td-kpi-icon { background: var(--nq-warning-soft, #fff5e0); color: var(--nq-warning, #b7791f); }
.nq-td-kpi.tone-won .nq-td-kpi-icon { background: var(--nq-success-soft, #e6f8f2); color: var(--nq-success, #0a9b7d); }
.nq-td-kpi.tone-value .nq-td-kpi-icon { background: var(--nq-accent-soft); color: var(--nq-accent); }
.nq-td-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--nq-muted);
}
.nq-td-kpi-value {
  margin-top: 2px;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--nq-ink-strong, var(--nq-ink));
  line-height: 1.25;
  word-break: break-word;
}
.nq-td-kpi-hint {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--nq-muted-2, var(--nq-muted));
  line-height: 1.45;
}

/* ---- Layout cards ----------------------------------------------------- */
.nq-td-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.nq-td-card {
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface) 94%, transparent);
  min-width: 0;
}
.nq-td-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--nq-line);
  font-weight: 700;
  font-size: 13.5px;
}
.nq-td-card-b { padding: 10px 14px 14px; }

.nq-td-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nq-td-timeline li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--nq-line);
}
.nq-td-timeline li:last-child { border-bottom: 0; }
.nq-td-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 6px;
  background: var(--nq-primary-300);
}
.nq-td-dot.overdue { background: var(--nq-danger, #c23b3b); }
.nq-td-dot.soon { background: var(--nq-warning, #c98912); }
.nq-td-tl-title { font-weight: 650; font-size: 13px; }
.nq-td-tl-title a { color: inherit; text-decoration: none; }
.nq-td-tl-title a:hover { color: var(--nq-primary-700); }
.nq-td-tl-meta { font-size: 12px; color: var(--nq-muted); margin-top: 2px; }
.nq-td-tl-date { font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--nq-ink-2); }

.nq-td-attn { list-style: none; margin: 0; padding: 0; }
.nq-td-attn li { padding: 8px 0; border-bottom: 1px solid var(--nq-line); font-size: 13px; }
.nq-td-attn li:last-child { border-bottom: 0; }
.nq-td-attn a { color: inherit; text-decoration: none; font-weight: 650; }
.nq-td-attn a:hover { color: var(--nq-primary-700); }

/* ---- Toolbar / filters ------------------------------------------------ */
.nq-td-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface) 94%, transparent);
}
.nq-td-toolbar-main { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; flex: 1; }
.nq-td-search {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--nq-line);
  border-radius: 11px;
  background: var(--nq-surface);
  padding: 0 10px;
  min-width: min(260px, 100%);
  color: var(--nq-muted);
}
.nq-td-search input {
  border: 0; outline: 0; background: transparent;
  color: var(--nq-ink); font-size: 13px; padding: 8px 0; width: 100%;
}
.nq-td-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nq-td-chip {
  appearance: none;
  border: 1px solid var(--nq-line);
  background: var(--nq-surface-2, var(--nq-surface));
  color: var(--nq-ink-2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.3;
}
.nq-td-chip:hover { border-color: var(--nq-primary-300); color: var(--nq-primary-700); }
.nq-td-chip.is-active {
  background: var(--nq-primary);
  border-color: var(--nq-primary);
  color: var(--nq-on-primary);
}
.nq-td-views { display: flex; gap: 4px; }
.nq-td-views button, .nq-td-views a {
  appearance: none;
  border: 1px solid var(--nq-line);
  background: var(--nq-surface);
  color: var(--nq-ink-2);
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  text-decoration: none;
}
.nq-td-views button.is-active, .nq-td-views a.is-active {
  background: var(--nq-primary-50);
  border-color: var(--nq-primary-300);
  color: var(--nq-primary-700);
}

/* ---- Status chips ----------------------------------------------------- */
.nq-td-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  background: var(--nq-surface-3, var(--nq-bg-soft));
  color: var(--nq-ink-2);
  white-space: nowrap;
}
.nq-td-st::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.nq-td-st.tone-slate { background: var(--nq-surface-3, #eef0f5); color: var(--nq-muted); }
.nq-td-st.tone-blue { background: var(--nq-primary-50); color: var(--nq-primary-700); }
.nq-td-st.tone-green { background: var(--nq-success-soft, #e6f8f2); color: var(--nq-success, #0a9b7d); }
.nq-td-st.tone-rose { background: var(--nq-danger-soft, #fde8e8); color: var(--nq-danger, #c23b3b); }
.nq-td-st.tone-amber { background: var(--nq-warning-soft, #fff5e0); color: var(--nq-warning, #b7791f); }

/* ---- Kanban ----------------------------------------------------------- */
.nq-td-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.nq-td-col {
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface-2, var(--nq-bg-soft)) 80%, transparent);
  min-width: 200px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}
.nq-td-col-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
  font-size: 12.5px;
  font-weight: 750;
}
.nq-td-col-n {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: var(--nq-surface);
  border: 1px solid var(--nq-line);
  color: var(--nq-muted);
}
.nq-td-col-b { padding: 0 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nq-td-carditem {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--nq-surface);
  border: 1px solid var(--nq-line);
  border-radius: 12px;
  padding: 10px 11px 9px;
}
.nq-td-carditem:hover { border-color: var(--nq-primary-300); box-shadow: var(--nq-focus-ring); }
.nq-td-carditem-ref { font-size: 11px; font-weight: 700; color: var(--nq-muted); }
.nq-td-carditem-title { font-size: 13.5px; font-weight: 700; margin-top: 2px; line-height: 1.4; }
.nq-td-carditem-meta { margin-top: 6px; font-size: 12px; color: var(--nq-muted); display: flex; flex-wrap: wrap; gap: 6px 10px; }
.nq-td-date.overdue { color: var(--nq-danger, #c23b3b); font-weight: 750; }
.nq-td-date.soon { color: var(--nq-warning, #b7791f); font-weight: 700; }

/* ---- Tables ----------------------------------------------------------- */
.nq-td-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--nq-line); border-radius: 16px; background: color-mix(in srgb, var(--nq-surface) 94%, transparent); }
.nq-td-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nq-td-table th, .nq-td-table td {
  padding: 9px 12px;
  text-align: start;
  border-bottom: 1px solid var(--nq-line);
  vertical-align: middle;
}
.nq-td-table th {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--nq-muted);
  background: var(--nq-surface-2, var(--nq-surface));
  white-space: nowrap;
}
.nq-td-table tr:last-child td { border-bottom: 0; }
.nq-td-table tbody tr { cursor: pointer; }
.nq-td-table tbody tr:hover { background: var(--nq-primary-50); }
.nq-td-table a { color: inherit; text-decoration: none; font-weight: 700; }
.nq-td-table a:hover { color: var(--nq-primary-700); }
.nq-td-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nq-td-table tr.is-low td { background: color-mix(in srgb, var(--nq-success-soft, #e6f8f2) 70%, transparent); }
.nq-td-table .nq-td-soonest { font-weight: 700; }

/* ---- Record view ------------------------------------------------------ */
.nq-td-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--nq-muted);
  text-decoration: none;
  margin-bottom: 8px;
}
.nq-td-back:hover { color: var(--nq-primary-700); }
.nq-td-record-title { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.nq-td-record-title h1 { margin: 0; font-size: 1.3rem; font-weight: 750; }
.nq-td-ref { font-size: 13px; color: var(--nq-muted); font-weight: 700; }

.nq-td-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  margin: 14px 0 4px;
  padding: 10px 8px;
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface) 94%, transparent);
  overflow-x: auto;
}
.nq-td-step {
  appearance: none;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--nq-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 8px;
  cursor: default;
  white-space: nowrap;
}
.nq-td-step.can-set { cursor: pointer; }
.nq-td-step.can-set:hover { color: var(--nq-primary-700); }
.nq-td-step-n {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--nq-line-strong, var(--nq-line));
  font-size: 11px;
  background: var(--nq-surface);
}
.nq-td-step.is-done { color: var(--nq-primary-700); }
.nq-td-step.is-done .nq-td-step-n {
  background: var(--nq-primary);
  border-color: var(--nq-primary);
  color: var(--nq-on-primary);
}
.nq-td-step.is-current { color: var(--nq-ink-strong, var(--nq-ink)); }
.nq-td-step.is-current .nq-td-step-n {
  border-color: var(--nq-primary);
  box-shadow: var(--nq-focus-ring);
  color: var(--nq-primary-700);
  font-weight: 800;
}
.nq-td-step.is-terminal-on { color: var(--nq-danger, #c23b3b); }
.nq-td-step.is-terminal-on .nq-td-step-n {
  border-color: var(--nq-danger, #c23b3b);
  background: var(--nq-danger-soft, #fde8e8);
  color: var(--nq-danger, #c23b3b);
}
.nq-td-step-line {
  width: 22px;
  height: 2px;
  background: var(--nq-line-strong, var(--nq-line));
  flex: 0 0 auto;
}
.nq-td-step-line.is-done { background: var(--nq-primary-300); }

.nq-td-smart {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.nq-td-smart a, .nq-td-smart button, .nq-td-smart span.nq-td-stat {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--nq-line);
  background: var(--nq-surface);
  border-radius: 12px;
  padding: 7px 11px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font-size: 12.5px;
}
.nq-td-smart a:hover, .nq-td-smart button:hover { border-color: var(--nq-primary-300); }
.nq-td-smart .nq-td-stat.is-disabled, .nq-td-smart span.nq-td-stat {
  cursor: default;
  opacity: 0.72;
}
.nq-td-stat b {
  font-size: 15px;
  font-weight: 800;
  color: var(--nq-primary-700);
  font-variant-numeric: tabular-nums;
}
.nq-td-soon { font-size: 10.5px; font-weight: 750; color: var(--nq-muted); border: 1px dashed var(--nq-line); border-radius: 999px; padding: 1px 6px; }

.nq-td-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 0;
  border-bottom: 1px solid var(--nq-line);
}
.nq-td-tabs a, .nq-td-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--nq-muted);
  cursor: pointer;
  text-decoration: none;
}
.nq-td-tabs a.is-active, .nq-td-tabs button.is-active {
  color: var(--nq-primary-700);
  border-bottom-color: var(--nq-primary);
}

.nq-td-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface) 94%, transparent);
}
.nq-td-form.full { grid-template-columns: 1fr; }
.nq-td-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nq-td-field.span-2 { grid-column: 1 / -1; }
.nq-td-field label, .nq-td-field .lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--nq-muted);
}
.nq-td-field input, .nq-td-field select, .nq-td-field textarea {
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--nq-line);
  border-radius: 10px;
  background: var(--nq-surface);
  color: var(--nq-ink);
  width: 100%;
}
.nq-td-field textarea { min-height: 86px; resize: vertical; }
.nq-td-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* ---- Coming soon / empty ---------------------------------------------- */
.nq-td-soonbox {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed var(--nq-line-strong, var(--nq-line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--nq-surface-2, var(--nq-surface)) 90%, transparent);
  color: var(--nq-muted);
  font-size: 13px;
  line-height: 1.7;
}
.nq-td-soonbox strong { color: var(--nq-ink-2); }
.nq-td-empty { margin-top: 24px; }

/* ---- Reports bars ----------------------------------------------------- */
.nq-td-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.nq-td-bar-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 3rem; gap: 8px; align-items: center; font-size: 12.5px; }
.nq-td-bar-track { height: 8px; border-radius: 99px; background: var(--nq-surface-3, var(--nq-bg-soft)); overflow: hidden; }
.nq-td-bar-fill { height: 100%; border-radius: 99px; background: var(--nq-primary); }
.nq-td-currencies { display: flex; flex-wrap: wrap; gap: 8px; }
.nq-td-cur {
  border: 1px solid var(--nq-line);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--nq-surface);
}
.nq-td-cur small { display: block; color: var(--nq-muted); font-weight: 700; font-size: 11px; }
.nq-td-cur b { font-size: 14px; }

.nq-td-note { font-size: 12px; color: var(--nq-muted); margin-top: 8px; line-height: 1.6; }

@media (max-width: 960px) {
  .nq-td-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nq-td-grid { grid-template-columns: 1fr; }
  .nq-td-form { grid-template-columns: 1fr; }
  .nq-td-field.span-2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .nq-td-kpis { grid-template-columns: 1fr; }
  .nq-td-kanban { grid-template-columns: repeat(5, minmax(220px, 1fr)); }
}
