/* NAQAAE Coordinator Portal — components
 *
 * Classes are intentionally framework-agnostic so the existing shadcn
 * components can adopt them without a rebuild.
 */

.nq {
  font-family: var(--font-sans);
  color: var(--role-text);
  direction: rtl;
}

/* English mode keeps LTR layout even though the portal defaults to RTL. */
.nq[dir="ltr"] {
  direction: ltr;
}

.nq-btn {
  font: 600 14px/20px var(--font-sans);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.nq-btn:focus-visible {
  outline: 2px solid var(--role-focus);
  outline-offset: 2px;
}
.nq-btn-primary {
  background: var(--role-btn-primary);
  color: var(--surface-000);
}
.nq-btn-primary:hover {
  background: var(--navy-700);
}
.nq-btn-secondary {
  background: var(--role-btn-secondary);
  color: var(--brand-navy);
  border-color: var(--border-strong);
}
.nq-btn-secondary:hover {
  background: var(--surface-100);
}
.nq-btn-danger {
  background: var(--brand-crimson);
  color: var(--surface-000);
}
.nq-btn-danger:hover {
  background: var(--crimson-700);
}
.nq-btn[disabled] {
  background: var(--surface-100);
  color: var(--ink-muted);
  border-color: var(--surface-100);
  cursor: not-allowed;
}

.nq-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font: 500 13px/20px var(--font-sans);
  padding: 2px var(--space-2) 2px var(--space-3);
  border-radius: var(--radius-pill);
}
.nq-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.nq-badge.draft {
  color: var(--status-draft-fg);
  background: var(--status-draft-bg);
}
.nq-badge.action {
  color: var(--status-action-fg);
  background: var(--status-action-bg);
}
.nq-badge.progress {
  color: var(--status-progress-fg);
  background: var(--status-progress-bg);
}
.nq-badge.done {
  color: var(--status-done-fg);
  background: var(--status-done-bg);
}
.nq-badge.attention {
  color: var(--status-attention-fg);
  background: var(--status-attention-bg);
}
.nq-badge.rejected {
  color: var(--status-rejected-fg);
  background: var(--status-rejected-bg);
}
.nq-badge.closed {
  color: var(--status-closed-fg);
  background: var(--status-closed-bg);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Delegation cards use the "attention" role (coordinator must act). */
.nq-card-attention {
  border-color: color-mix(in srgb, var(--status-attention-fg) 28%, var(--border-subtle));
}
.nq-card-attention-head {
  background: linear-gradient(to right, var(--status-attention-bg), var(--surface-000));
  border-bottom: 1px solid color-mix(in srgb, var(--status-attention-fg) 20%, var(--border-subtle));
}
.nq-panel-attention {
  background: var(--status-attention-bg);
  border: 1px solid color-mix(in srgb, var(--status-attention-fg) 28%, var(--border-subtle));
}
.nq-text-attention {
  color: var(--status-attention-fg);
}

.nq-alert {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font: 400 14px/22px var(--font-sans);
}
.nq-alert b {
  display: block;
  font-weight: 600;
}
/* Circular icon chip. Uses currentColor so it adapts to light and dark. */
.nq-alert > svg,
.nq-alert .ico {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.nq-alert .ico {
  padding: 0;
  color: var(--surface-000);
  font: 700 13px/26px var(--font-sans);
  text-align: center;
}
.nq-alert.info {
  background: var(--status-progress-bg);
  color: var(--status-progress-fg);
}
.nq-alert.success {
  background: var(--status-done-bg);
  color: var(--status-done-fg);
}
.nq-alert.warning {
  background: var(--status-attention-bg);
  color: var(--status-attention-fg);
}
.nq-alert.error {
  background: var(--status-rejected-bg);
  color: var(--status-rejected-fg);
}

.nq-steps {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  font: 500 13px/20px var(--font-sans);
}
.nq-steps li {
  flex: 1;
  min-width: 84px;
  position: relative;
  text-align: center;
  color: var(--ink-muted);
  padding-top: 36px;
}
.nq-steps li::before {
  content: attr(data-n);
  position: absolute;
  top: 0;
  right: 50%;
  transform: translateX(50%);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--surface-000);
  border: 2px solid var(--border-strong);
  color: var(--ink-muted);
  font: 600 13px/24px var(--font-sans);
  z-index: 1;
}
.nq-steps li::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-subtle);
}
.nq-steps li:last-child::after {
  display: none;
}
.nq-steps li.done {
  color: var(--teal-700);
}
.nq-steps li.done::before {
  content: "✓";
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  color: var(--ink);
}
.nq-steps li.done::after {
  background: var(--brand-teal);
}
.nq-steps li.current {
  color: var(--brand-navy);
  font-weight: 700;
}
.nq-steps li.current::before {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: var(--surface-000);
}

/* ---------------------------------------------------------------------------
   KPI stat cards
   A soft tint of one palette colour per card. Only the surface and the icon
   chip are tinted: the label and the number stay on role tokens, so they keep
   their full text contrast instead of being washed out by the tint.
   --------------------------------------------------------------------------- */
.nq-stat {
  --stat-accent: var(--brand-navy);
  --stat-fg: var(--brand-navy);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--stat-accent) 26%, var(--border-subtle));
  background: color-mix(in srgb, var(--stat-accent) 8%, var(--surface-000));
}
.nq-stat--navy {
  --stat-accent: var(--brand-navy);
  --stat-fg: var(--brand-navy);
}
.nq-stat--amber {
  --stat-accent: var(--brand-amber);
  --stat-fg: var(--amber-800);
}
.nq-stat--teal {
  --stat-accent: var(--brand-teal);
  --stat-fg: var(--teal-700);
}
.nq-stat--blue {
  --stat-accent: var(--brand-blue);
  --stat-fg: var(--blue-700);
}
.nq-stat--crimson { --stat-accent: var(--brand-crimson); --stat-fg: var(--crimson-700); }
.nq-stat__icon {
  background: color-mix(in srgb, var(--stat-accent) 18%, transparent);
  color: var(--stat-fg);
}
.dark .nq-stat {
  background: color-mix(in srgb, var(--stat-accent) 22%, var(--surface-050));
  border-color: color-mix(in srgb, var(--stat-accent) 34%, var(--border-subtle));
}
.dark .nq-stat--navy {
  --stat-fg: var(--brand-sky);
}
.dark .nq-stat--amber {
  --stat-fg: var(--status-attention-fg);
}
.dark .nq-stat--teal {
  --stat-fg: var(--status-done-fg);
}
.dark .nq-stat--blue {
  --stat-fg: var(--status-progress-fg);
}
.dark .nq-stat--crimson { --stat-fg: var(--status-rejected-fg); }
.dark .nq-stat__icon {
  background: color-mix(in srgb, var(--stat-accent) 26%, transparent);
  color: var(--stat-fg);
}

/* ---------------------------------------------------------------------------
   Summary hero — the same tinting idea as .nq-stat, at section scale.
   The accent follows the workflow category so the tint always means something.
   --------------------------------------------------------------------------- */
.nq-hero {
  --hero-accent: var(--brand-navy);
  background: color-mix(in srgb, var(--hero-accent) 7%, var(--surface-000));
  border-color: color-mix(in srgb, var(--hero-accent) 22%, var(--border-subtle));
}
.nq-hero--draft {
  --hero-accent: var(--brand-navy);
}
.nq-hero--action {
  --hero-accent: var(--brand-orange);
}
.nq-hero--progress {
  --hero-accent: var(--brand-blue);
}
.nq-hero--done {
  --hero-accent: var(--brand-teal);
}
.nq-hero--attention {
  --hero-accent: var(--brand-amber);
}
.nq-hero--rejected {
  --hero-accent: var(--brand-crimson);
}
.nq-hero--closed {
  --hero-accent: var(--ink-muted);
}
.dark .nq-hero {
  background: color-mix(in srgb, var(--hero-accent) 16%, var(--surface-050));
  border-color: color-mix(in srgb, var(--hero-accent) 30%, var(--border-subtle));
}
