/* ─────────────────────────────────────────────────────────────────────────────
   Netcore LP Engine — Dashboard Design System
   Brand: Inter font · #F05A28 orange · #1C0808 sidebar · #0a8a7a teal
   ───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Schibsted+Grotesk:wght@400;500;600;700&display=swap');

/* ── Reset & tokens ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --nc-orange     : #FC5E02;
  --nc-orange2    : #FF7A2F;
  --nc-teal       : #0a8a7a;
  --nc-teal-light : rgba(10,138,122,.12);
  --nc-dark       : #1A1A2E;
  --nc-dark2      : #252540;

  /* Surfaces */
  --bg            : #F7F7F8;
  --surface       : #ffffff;
  --surface2      : #F4F4F5;
  --border        : #EBEBEC;
  --border2       : #F0F0F1;

  /* Text */
  --ink           : #3e3444;
  --ink2          : #5a5060;
  --ink3          : #6B7280;
  --ink4          : #9CA3AF;

  /* Status */
  --green         : #0a8a7a;
  --green-bg      : rgba(10,138,122,.10);
  --amber         : #D97706;
  --amber-bg      : rgba(217,119,6,.10);
  --red           : #DC2626;
  --red-bg        : rgba(220,38,38,.10);
  --blue          : #2563EB;
  --blue-bg       : rgba(37,99,235,.10);

  /* Misc */
  --shadow        : 0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg     : 0 8px 32px rgba(0,0,0,.1);
  --radius        : 10px;
  --radius-lg     : 12px;
  --sidebar-w     : 228px;
}

html, body { height: 100%; }

body {
  font-family: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background : var(--bg);
  color      : var(--ink);
  font-size  : 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  color      : var(--ink);
}

/* ── App shell ───────────────────────────────────────────────────────────────── */
.nc-app { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.nc-sidebar {
  width          : var(--sidebar-w);
  flex-shrink    : 0;
  background     : var(--surface);
  border-right   : 1px solid var(--border);
  display        : flex;
  flex-direction : column;
  position       : fixed;
  top            : 0; left: 0; bottom: 0;
  z-index        : 200;
  overflow       : hidden;
}

.nc-sidebar-brand {
  display        : flex;
  align-items    : center;
  gap            : 10px;
  padding        : 18px 18px 16px;
  text-decoration: none;
  border-bottom  : 1px solid var(--border);
  flex-shrink    : 0;
}
.nc-brand-logo {
  height    : 22px;
  width     : auto;
  display   : block;
  flex-shrink: 0;
}
.nc-brand-product {
  font-size  : 13px;
  font-weight: 700;
  color      : var(--ink);
  letter-spacing: -.1px;
}


.nc-sidebar-nav {
  flex     : 1;
  padding  : 16px 10px;
  overflow-y: auto;
}

.nc-nav-item {
  display        : flex;
  align-items    : center;
  gap            : 10px;
  padding        : 9px 12px;
  border-radius  : var(--radius);
  font-size      : 13px;
  font-weight    : 500;
  color          : var(--ink3);
  text-decoration: none;
  transition     : background .15s, color .15s;
  margin-bottom  : 2px;
}
.nc-nav-item svg { flex-shrink: 0; opacity: .55; transition: opacity .15s; }
.nc-nav-item:hover { background: var(--surface2); color: var(--ink); }
.nc-nav-item:hover svg { opacity: .9; }
.nc-nav-item.active {
  background  : rgba(252,94,2,.08);
  color       : var(--nc-orange);
  font-weight : 600;
}
.nc-nav-item.active svg { opacity: 1; }

.nc-nav-section-label {
  font-size    : 10px;
  font-weight  : 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color        : var(--ink4);
  padding      : 10px 10px 4px;
}

/* ── Topbar user profile ─────────────────────────────────────────────────────── */
.nc-topbar-user {
  display      : flex;
  align-items  : center;
  gap          : 0;
  margin-left  : 8px;
  padding-left : 12px;
  border-left  : 1px solid var(--border);
  flex-shrink  : 0;
}
/* User pill — wraps label + avatar */
.nc-user-pill {
  display      : flex;
  align-items  : center;
  gap          : 9px;
  padding      : 5px 6px 5px 10px;
  border-radius: 100px;
  border       : 1px solid transparent;
  cursor       : pointer;
  transition   : background .15s, border-color .15s;
  position     : relative;
}
.nc-user-pill:hover {
  background  : var(--surface2);
  border-color: var(--border);
}
.nc-lock-label {
  font-size    : 13px;
  font-weight  : 500;
  color        : var(--ink2);
  white-space  : nowrap;
  overflow     : hidden;
  text-overflow: ellipsis;
  max-width    : 140px;
}
.nc-lock-btn {
  width          : 30px;
  height         : 30px;
  border-radius  : 50%;
  background     : var(--nc-orange);
  border         : none;
  display        : flex;
  align-items    : center;
  justify-content: center;
  color          : #fff;
  cursor         : pointer;
  font-size      : 10.5px;
  font-weight    : 700;
  letter-spacing : .4px;
  text-transform : uppercase;
  transition     : background .15s;
  flex-shrink    : 0;
  position       : relative;
}
.nc-lock-btn:hover { background: #e05400; }

/* ── User dropdown (opens downward from topbar) ──────────────────────────────── */
.nc-user-dropdown {
  position     : absolute;
  top          : calc(100% + 8px);
  right        : 0;
  left         : auto;
  background   : var(--surface);
  border       : 1px solid var(--border);
  border-radius: 10px;
  min-width    : 170px;
  padding      : 6px 0;
  box-shadow   : var(--shadow-lg);
  z-index      : 999;
  display      : none;
}
.nc-user-dropdown.open { display: block; }
.nc-user-dropdown-item {
  display    : flex;
  align-items: center;
  gap        : 10px;
  padding    : 9px 14px;
  font-size  : 13px;
  color      : var(--ink2);
  cursor     : pointer;
  transition : background .12s, color .12s;
  white-space: nowrap;
  border     : none;
  background : none;
  width      : 100%;
  text-align : left;
  text-decoration: none;
}
.nc-user-dropdown-item:hover { background: rgba(240,90,40,.06); color: var(--ink); }
.nc-user-dropdown-item.danger { color: var(--red); }
.nc-user-dropdown-item.danger:hover { background: var(--red-bg); }
.nc-user-dropdown-divider {
  height    : 1px;
  background: var(--border);
  margin    : 5px 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.nc-footer {
  text-align : center;
  padding    : 14px 28px;
  font-size  : 12px;
  color      : rgba(255,255,255,.5);
  background : #1E1B2E;
  margin-top : auto;
  flex-shrink: 0;
}

/* ── Leads filter select ─────────────────────────────────────────────────────── */
.nc-filter-select {
  appearance   : none;
  -webkit-appearance: none;
  padding      : 9px 32px 9px 34px;
  border       : 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size    : 13px;
  font-family  : inherit;
  color        : var(--ink2);
  background   : var(--surface);
  cursor       : pointer;
  outline      : none;
  transition   : border-color .15s, box-shadow .15s;
  min-width    : 150px;
}
.nc-filter-select:focus {
  border-color : var(--nc-orange);
  box-shadow   : 0 0 0 3px rgba(240,90,40,.1);
}
.nc-filter-select:hover { border-color: var(--ink4); }

/* chevron arrow on the right */
.nc-filter-select + * { display:none; }
div:has(> .nc-filter-select)::after {
  content     : '';
  pointer-events: none;
  position    : absolute;
  right       : 11px;
  top         : 50%;
  transform   : translateY(-50%);
  width       : 0;
  height      : 0;
  border-left : 4px solid transparent;
  border-right: 4px solid transparent;
  border-top  : 5px solid var(--ink4);
}

/* ── Leads search bar ────────────────────────────────────────────────────────── */
.nc-search-wrap {
  position    : relative;
  margin-bottom: 12px;
}
.nc-search-wrap svg {
  position : absolute;
  left     : 12px;
  top      : 50%;
  transform: translateY(-50%);
  color    : var(--ink4);
  pointer-events: none;
}
.nc-search-input {
  width        : 100%;
  padding      : 9px 14px 9px 38px;
  border       : 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family  : inherit;
  font-size    : 13px;
  color        : var(--ink);
  background   : var(--surface);
  outline      : none;
  transition   : border-color .15s, box-shadow .15s;
}
.nc-search-input::placeholder { color: var(--ink4); }
.nc-search-input:focus {
  border-color: var(--nc-orange);
  box-shadow  : 0 0 0 3px rgba(240,90,40,.1);
}

/* ── Split button (Sync) ─────────────────────────────────────────────────────── */
.nc-split-btn {
  position   : relative;
  display    : inline-flex;
  align-items: center;
  border-radius: var(--radius);
  box-shadow : 0 0 0 1px var(--border);
}
.nc-split-main {
  display    : inline-flex;
  align-items: center;
  gap        : 6px;
  height     : 30px;
  padding    : 0 11px;
  font-size  : 12px;
  font-weight: 600;
  color      : var(--ink2);
  background : var(--bg);
  border     : none;
  border-radius: var(--radius) 0 0 var(--radius);
  cursor     : pointer;
  transition : background .15s, color .15s;
}
.nc-split-main:hover { background: var(--surface2); color: var(--ink); }
.nc-split-main:disabled { opacity: .45; cursor: not-allowed; }
.nc-split-arrow {
  display    : flex;
  align-items: center;
  justify-content: center;
  width      : 26px;
  height     : 30px;
  background : var(--bg);
  border     : none;
  border-left: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor     : pointer;
  color      : var(--ink3);
  transition : background .15s, color .15s;
}
.nc-split-arrow:hover { background: var(--surface2); color: var(--ink); }
.nc-split-dropdown {
  position  : absolute;
  top       : calc(100% + 5px);
  right     : 0;
  min-width : 230px;
  background: var(--bg);
  border    : 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index   : 200;
  overflow  : hidden;
}
.nc-split-option {
  display   : block;
  width     : 100%;
  padding   : 11px 14px;
  text-align: left;
  background: transparent;
  border    : none;
  cursor    : pointer;
  transition: background .12s;
}
.nc-split-option:hover { background: var(--surface2); }
.nc-split-option-title {
  font-size  : 13px;
  font-weight: 600;
  color      : var(--ink);
  margin-bottom: 2px;
}
.nc-split-option-sub {
  font-size: 11px;
  color    : var(--ink4);
}
.nc-split-divider {
  height    : 1px;
  background: var(--border);
  margin    : 0;
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.nc-pagination {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : 14px 4px 4px;
  flex-wrap      : wrap;
  gap            : 10px;
}
.nc-pagination-info {
  font-size  : 12px;
  color      : var(--ink4);
}
.nc-pagination-btns {
  display : flex;
  gap     : 4px;
  flex-wrap: wrap;
}
.nc-page-btn {
  min-width    : 34px;
  height       : 32px;
  padding      : 0 10px;
  border       : 1px solid var(--border);
  border-radius: var(--radius);
  background   : var(--bg);
  color        : var(--ink2);
  font-size    : 12px;
  font-weight  : 500;
  cursor       : pointer;
  transition   : background .15s, border-color .15s, color .15s;
}
.nc-page-btn:hover:not([disabled]) {
  background   : var(--surface2);
  border-color : var(--nc-orange);
  color        : var(--nc-orange);
}
.nc-page-btn.active {
  background   : var(--nc-orange);
  border-color : var(--nc-orange);
  color        : #fff;
  font-weight  : 700;
}
.nc-page-btn[disabled] {
  opacity: .35;
  cursor : not-allowed;
}
.nc-page-ellipsis {
  display      : flex;
  align-items  : center;
  justify-content: center;
  min-width    : 28px;
  height       : 32px;
  font-size    : 12px;
  color        : var(--ink4);
}

/* ── Main content ────────────────────────────────────────────────────────────── */
.nc-main {
  margin-left : var(--sidebar-w);
  flex        : 1;
  min-width   : 0;
  display     : flex;
  flex-direction: column;
}

.nc-topbar {
  background    : var(--surface);
  border-bottom : 1px solid var(--border);
  height        : 58px;
  display       : flex;
  align-items   : center;
  padding       : 0 28px;
  gap           : 12px;
  position      : sticky;
  top           : 0;
  z-index       : 100;
}
.nc-topbar-title {
  font-size    : 16px;
  font-weight  : 800;
  color        : var(--ink);
  letter-spacing: -.25px;
}
.nc-topbar-sub {
  font-size  : 12px;
  color      : var(--ink4);
  margin-top : 1px;
  font-weight: 400;
}
.nc-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.nc-page { padding: 28px; }
.nc-page-header {
  display       : flex;
  align-items   : flex-start;
  justify-content: space-between;
  gap           : 16px;
  margin-bottom : 24px;
  flex-wrap     : wrap;
}
.nc-page-title { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.nc-page-sub   { font-size: 13px; color: var(--ink3); margin-top: 4px; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.nc-card {
  background   : var(--surface);
  border       : 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding      : 22px;
  box-shadow   : var(--shadow);
  transition   : border-color .2s, box-shadow .2s;
}
.nc-card-header {
  display       : flex;
  align-items   : center;
  justify-content: space-between;
  margin-bottom : 18px;
}
.nc-card-title { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -.1px; }
.nc-card-sub   { font-size: 12px; color: var(--ink3); margin-top: 3px; }

/* ── Stat cards (dashboard) ──────────────────────────────────────────────────── */
.nc-stats-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap                  : 16px;
  margin-bottom        : 24px;
}
.nc-stats-grid-2 {
  grid-template-columns: repeat(2, minmax(180px, 320px));
}
.nc-stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.nc-stat-card {
  background   : var(--surface);
  border       : 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding      : 22px 22px 18px;
  box-shadow   : var(--shadow);
  transition   : border-color .2s, box-shadow .2s;
}
.nc-stat-card:hover {
  border-color: #D0D0D2;
  box-shadow  : 0 4px 20px rgba(0,0,0,.07);
}
.nc-stat-label {
  font-size    : 11px;
  font-weight  : 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color        : var(--ink4);
  margin-bottom: 10px;
}
.nc-stat-value {
  font-size    : 36px;
  font-weight  : 800;
  color        : var(--ink);
  line-height  : 1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}
.nc-stat-hint  { font-size: 12px; color: var(--ink4); }
.nc-stat-card.orange { border-left: 4px solid var(--nc-orange); padding-left: 18px; }
.nc-stat-card.teal   { border-left: 4px solid var(--nc-teal);   padding-left: 18px; }
.nc-stat-card.amber  { border-left: 4px solid var(--amber);     padding-left: 18px; }
.nc-stat-card.green  { border-left: 4px solid var(--green);     padding-left: 18px; }

/* ── Status chips ────────────────────────────────────────────────────────────── */
.nc-chip {
  display     : inline-flex;
  align-items : center;
  gap         : 5px;
  padding     : 3px 9px;
  border-radius: 20px;
  font-size   : 11px;
  font-weight : 600;
  white-space : nowrap;
}
.nc-chip-none       { background: var(--surface2);  color: var(--ink4); }
.nc-chip-processing { background: var(--amber-bg); color: var(--amber); }
.nc-chip-ready      { background: var(--blue-bg);   color: var(--blue); }
.nc-chip-approved   { background: var(--green-bg);  color: var(--green); }
.nc-chip-error      { background: var(--red-bg);    color: var(--red); }
.nc-chip-needs_manual_fix { background: var(--amber-bg); color: var(--amber); }

.nc-chip-processing::before {
  content      : '';
  width        : 7px; height: 7px;
  border       : 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation    : nc-spin .7s linear infinite;
  display      : inline-block;
}
@keyframes nc-spin { to { transform: rotate(360deg); } }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.nc-btn {
  display        : inline-flex;
  align-items    : center;
  gap            : 6px;
  padding        : 8px 16px;
  border-radius  : var(--radius);
  font-size      : 13px;
  font-weight    : 600;
  cursor         : pointer;
  border         : 1.5px solid transparent;
  transition     : all .15s ease;
  text-decoration: none;
  white-space    : nowrap;
  line-height    : 1;
}
.nc-btn-primary { background: var(--nc-orange); color: #fff; }
.nc-btn-primary:hover { background: var(--nc-orange2); }
.nc-btn-secondary { background: var(--surface); color: var(--ink2); border-color: var(--border); }
.nc-btn-secondary:hover { background: var(--bg); border-color: var(--ink4); }
.nc-btn-teal { background: var(--nc-teal); color: #fff; }
.nc-btn-teal:hover { background: #097a6c; }
.nc-btn-ghost { background: transparent; color: var(--ink3); }
.nc-btn-ghost:hover { color: var(--ink); background: var(--bg); }
.nc-btn-danger { background: var(--red-bg); color: var(--red); border-color: rgba(220,38,38,.2); }
.nc-btn-danger:hover { background: rgba(220,38,38,.18); }
.nc-btn-sm { padding: 5px 11px; font-size: 12px; }
.nc-btn:disabled { opacity: .45; cursor: not-allowed; }
.nc-btn-icon {
  padding   : 6px;
  width     : 30px;
  height    : 30px;
  justify-content: center;
}
.nc-btn-icon svg { display: block; flex-shrink: 0; }
.nc-btn-icon.spinning svg { animation: nc-spin .6s linear infinite; }
@keyframes nc-spin { to { transform: rotate(360deg); } }

/* ── Table ───────────────────────────────────────────────────────────────────── */
.nc-table-wrap { overflow-x: auto; }
.nc-table {
  width          : 100%;
  border-collapse: collapse;
}
.nc-table th {
  text-align    : left;
  font-size     : 11px;
  font-weight   : 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color         : var(--ink4);
  padding       : 0 16px 12px;
  border-bottom : 1.5px solid var(--border);
  white-space   : nowrap;
}
.nc-table td {
  padding      : 14px 16px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}
.nc-table tr:last-child td { border-bottom: none; }
.nc-table tr:hover td { background: #FAFAFA; }
.nc-table .nc-company { font-weight: 700; font-size: 14px; letter-spacing: -.1px; }
.nc-table .nc-meta    { font-size: 12px; color: var(--ink3); margin-top: 3px; }

/* ── Attendee avatars ────────────────────────────────────────────────────────── */
.nc-avatar-group { position: relative; display: inline-block; }
.nc-avatar-stack { display: flex; align-items: center; }
.nc-avatar {
  width        : 26px;
  height       : 26px;
  border-radius: 50%;
  display      : flex;
  align-items  : center;
  justify-content: center;
  font-size    : 10px;
  font-weight  : 700;
  color        : #fff;
  border       : 2px solid var(--surface);
  flex         : none;
}
.nc-avatar + .nc-avatar { margin-left: -8px; }
.nc-avatar-more { background: var(--ink4) !important; font-size: 9px; }
.nc-avatar-popup {
  display      : none;
  position     : absolute;
  top          : calc(100% + 8px);
  left         : 0;
  min-width    : 220px;
  max-width    : 300px;
  max-height   : 260px;
  overflow-y   : auto;
  background   : var(--surface);
  border       : 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow   : var(--shadow-lg);
  padding      : 10px;
  z-index      : 50;
}
.nc-avatar-group:hover .nc-avatar-popup { display: block; }
.nc-avatar-popup-title {
  font-size     : 11px;
  font-weight   : 700;
  color         : var(--ink4);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom : 8px;
  padding       : 0 4px;
}
.nc-avatar-popup-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; }
.nc-avatar-popup-row:hover { background: var(--surface2); }
.nc-avatar-sm { width: 22px; height: 22px; font-size: 9px; border-width: 0; }
.nc-avatar-popup-text  { min-width: 0; }
.nc-avatar-popup-name  { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.nc-avatar-popup-email { font-size: 11px; color: var(--ink4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Source badge ────────────────────────────────────────────────────────────── */
.nc-source-badge {
  display     : inline-flex;
  align-items : center;
  gap         : 4px;
  font-size   : 10px;
  font-weight : 600;
  padding     : 2px 7px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.nc-source-crm    { background: var(--blue-bg);  color: var(--blue); }
.nc-source-avoma  { background: var(--green-bg); color: var(--green); }
.nc-source-manual { background: var(--amber-bg); color: var(--amber); }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.nc-tabs {
  display      : flex;
  gap          : 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.nc-tab {
  padding     : 10px 16px;
  font-size   : 13px;
  font-weight : 500;
  color       : var(--ink3);
  cursor      : pointer;
  border      : none;
  background  : none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition  : color .15s, border-color .15s;
  display     : flex;
  align-items : center;
  gap         : 6px;
}
.nc-tab:hover    { color: var(--ink); }
.nc-tab.active   { color: var(--nc-orange); border-bottom-color: var(--nc-orange); font-weight: 600; }
.nc-tab-panel    { display: none; }
.nc-tab-panel.active { display: block; }

/* ── Info rows (overview tab) ────────────────────────────────────────────────── */
.nc-info-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap                  : 14px;
}
.nc-info-item {
  background   : var(--bg);
  border       : 1px solid var(--border);
  border-radius: var(--radius);
  padding      : 12px 14px;
}
.nc-info-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink4); margin-bottom: 5px; }
.nc-info-value { font-size: 14px; font-weight: 600; color: var(--ink); }
.nc-info-source{ font-size: 10px; color: var(--ink4); margin-top: 3px; }
.nc-val-empty  { font-size: 14px; font-weight: 400; color: var(--ink4); font-style: italic; }

/* ── Pipeline steps ──────────────────────────────────────────────────────────── */
.nc-step-card {
  border       : 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow     : hidden;
  margin-bottom: 12px;
}
.nc-step-header {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : 14px 18px;
  background     : var(--surface);
  cursor         : pointer;
  user-select    : none;
  gap            : 12px;
}
.nc-step-header:hover { background: var(--bg); }
.nc-step-num {
  width          : 26px; height: 26px;
  border-radius  : 50%;
  background     : var(--nc-orange);
  color          : #fff;
  font-size      : 12px;
  font-weight    : 700;
  display        : flex;
  align-items    : center;
  justify-content: center;
  flex-shrink    : 0;
}
.nc-step-num.done   { background: var(--nc-teal); }
.nc-step-num.error  { background: var(--red); }
.nc-step-title { font-size: 14px; font-weight: 600; color: var(--ink); flex: 1; }
.nc-step-time  { font-size: 11px; color: var(--ink4); white-space: nowrap; }
.nc-step-caret { color: var(--ink4); transition: transform .2s; }
.nc-step-card.open .nc-step-caret { transform: rotate(180deg); }

.nc-step-body {
  display   : none;
  border-top: 1px solid var(--border);
}
.nc-step-card.open .nc-step-body { display: block; }

.nc-step-section {
  padding      : 14px 18px;
  border-bottom: 1px solid var(--border2);
}
.nc-step-section:last-child { border-bottom: none; }
.nc-step-section-label {
  font-size    : 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color        : var(--ink4); margin-bottom: 8px;
}
.nc-code {
  background   : #1A1A2E;
  color        : #C8D3F5;
  border-radius: var(--radius);
  padding      : 14px;
  font-family  : 'Fira Code', 'Cascadia Code', monospace;
  font-size    : 12px;
  line-height  : 1.6;
  overflow-x   : auto;
  white-space  : pre-wrap;
  word-break   : break-word;
}

/* ── Preview pane ────────────────────────────────────────────────────────────── */
.nc-preview-bar {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : 10px 14px;
  background     : var(--bg);
  border-bottom  : 1px solid var(--border);
  border-radius  : var(--radius-lg) var(--radius-lg) 0 0;
  gap            : 10px;
  flex-wrap      : wrap;
}
.nc-preview-dots { display: flex; gap: 5px; }
.nc-preview-dot  { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.nc-preview-dot:nth-child(1) { background: #FF5F57; }
.nc-preview-dot:nth-child(2) { background: #FEBC2E; }
.nc-preview-dot:nth-child(3) { background: #28C840; }

.nc-preview-wrap {
  border       : 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow     : hidden;
}
.nc-preview-iframe {
  width : 100%;
  height: 68vh;
  border: none;
  background: #f5f5f5;
  display: block;
}

/* ── Feedback tab ────────────────────────────────────────────────────────────── */
.nc-feedback-history { margin-bottom: 24px; }
.nc-feedback-entry {
  background   : var(--bg);
  border       : 1px solid var(--border);
  border-radius: var(--radius);
  padding      : 12px 14px;
  margin-bottom: 10px;
}
.nc-feedback-meta { font-size: 11px; color: var(--ink4); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nc-feedback-text { font-size: 13px; color: var(--ink2); }

.nc-rerun-selector {
  display              : grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap                  : 10px;
  margin-bottom        : 16px;
}
.nc-rerun-opt { position: relative; }
.nc-rerun-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.nc-rerun-opt label {
  display      : flex;
  flex-direction: column;
  gap          : 3px;
  padding      : 12px 14px;
  border       : 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor       : pointer;
  transition   : border-color .15s, background .15s;
}
.nc-rerun-opt input:checked + label {
  border-color: var(--nc-orange);
  background  : rgba(240,90,40,.05);
}
.nc-rerun-opt label .opt-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.nc-rerun-opt label .opt-sub   { font-size: 11px; color: var(--ink4); }
.nc-rerun-opt label .opt-steps { font-size: 10px; font-weight: 600; color: var(--nc-teal); margin-top: 2px; }

.nc-feedback-form textarea {
  width       : 100%;
  min-height  : 80px;
  padding     : 10px 13px;
  border      : 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size   : 13px;
  font-family : inherit;
  color       : var(--ink);
  resize      : vertical;
  transition  : border-color .15s;
}
.nc-feedback-form textarea:focus {
  outline     : none;
  border-color: var(--nc-orange);
  box-shadow  : 0 0 0 3px rgba(240,90,40,.1);
}

/* ── Revision Modal ──────────────────────────────────────────────────────────── */
.nc-modal-overlay {
  position  : fixed;
  inset     : 0;
  background: rgba(0, 0, 0, .45);
  display   : flex;
  align-items: center;
  justify-content: center;
  z-index   : 900;
  padding   : 24px;
  animation : ncFadeInBg .15s ease;
}
@keyframes ncFadeInBg { from { opacity: 0; } to { opacity: 1; } }

.nc-modal {
  background   : var(--surface);
  border       : 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow   : 0 24px 64px rgba(0, 0, 0, .18);
  width        : 100%;
  max-width    : 540px;
  padding      : 28px;
  animation    : ncModalIn .18s ease;
}
@keyframes ncModalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.nc-modal-header {
  display        : flex;
  align-items    : flex-start;
  justify-content: space-between;
  margin-bottom  : 20px;
  gap            : 12px;
}
.nc-modal-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.1px; }
.nc-modal-sub   { font-size: 12px; color: var(--ink4); margin-top: 3px; }

.nc-modal-close {
  flex-shrink  : 0;
  width        : 28px; height: 28px;
  background   : none;
  border       : none;
  border-radius: var(--radius);
  color        : var(--ink4);
  cursor       : pointer;
  display      : flex;
  align-items  : center;
  justify-content: center;
  transition   : background .15s, color .15s;
}
.nc-modal-close:hover { background: var(--surface2); color: var(--ink); }

.nc-modal-footer {
  display        : flex;
  align-items    : center;
  justify-content: flex-end;
  gap            : 8px;
  margin-top     : 20px;
  padding-top    : 16px;
  border-top     : 1px solid var(--border);
}

/* A .nc-btn defaults to white-space:nowrap (fine for short single-line
   labels) — these choice buttons hold a title + wrapping description, so
   they need their own width/wrap rules or the text forces the button (and
   the modal) to overflow horizontally. */
.nc-choice-btn {
  width          : 100%;
  white-space    : normal;
  flex-direction : column;
  align-items    : flex-start;
  justify-content: center;
  text-align     : left;
  padding        : 14px 16px;
  height         : auto;
  gap            : 0;
}
.nc-choice-btn-title { font-size: 13px; font-weight: 600; display: block; }
.nc-choice-btn-sub   { font-size: 12px; color: var(--ink4); font-weight: 400; display: block; margin-top: 2px; line-height: 1.45; }

.nc-start-fresh-row {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  gap            : 16px;
  margin-top     : 20px;
  padding-top    : 16px;
  border-top     : 1px solid var(--border);
}
.nc-start-fresh-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.nc-start-fresh-sub   { font-size: 11.5px; color: var(--ink4); line-height: 1.45; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.nc-form-group  { margin-bottom: 16px; }
.nc-form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nc-form-label  {
  display     : block;
  font-size   : 11px;
  font-weight : 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color       : var(--ink3);
  margin-bottom: 5px;
}
.nc-form-input, .nc-form-textarea, .nc-form-select {
  width       : 100%;
  padding     : 9px 12px;
  border      : 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size   : 13px;
  font-family : inherit;
  color       : var(--ink);
  background  : var(--surface);
  transition  : border-color .15s;
}
.nc-form-input:focus, .nc-form-textarea:focus, .nc-form-select:focus {
  outline     : none;
  border-color: var(--nc-orange);
  box-shadow  : 0 0 0 3px rgba(240,90,40,.1);
}
.nc-form-textarea { resize: vertical; min-height: 80px; }
.nc-form-hint     { font-size: 11px; color: var(--ink4); margin-top: 4px; }

.nc-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.nc-checkbox-item {
  display    : flex;
  align-items: center;
  gap        : 7px;
  font-size  : 13px;
  cursor     : pointer;
  padding    : 6px 10px;
  border     : 1px solid var(--border);
  border-radius: var(--radius);
  transition : border-color .15s, background .15s;
}
.nc-checkbox-item:hover { border-color: var(--nc-orange); background: rgba(240,90,40,.03); }
.nc-checkbox-item input { accent-color: var(--nc-orange); }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.nc-modal-backdrop {
  position       : fixed;
  inset          : 0;
  background     : rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  display        : flex;
  align-items    : center;
  justify-content: center;
  z-index        : 1000;
}
.nc-modal {
  background   : var(--surface);
  border-radius: var(--radius-lg);
  padding      : 28px;
  width        : 100%;
  max-width    : 520px;
  box-shadow   : var(--shadow-lg);
  max-height   : 90vh;
  overflow-y   : auto;
}
.nc-modal-lg { max-width: 680px; }
.nc-modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.nc-modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ── Admin login mini-modal ──────────────────────────────────────────────────── */
.nc-admin-modal {
  position     : fixed;
  bottom       : 70px;
  left         : 14px;
  width        : 200px;
  background   : var(--nc-dark2);
  border       : 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding      : 16px;
  z-index      : 1100;
  box-shadow   : var(--shadow-lg);
}
.nc-admin-modal-title { font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.nc-admin-modal input {
  width        : 100%;
  padding      : 8px 10px;
  border       : 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  background   : rgba(255,255,255,.07);
  color        : #fff;
  font-size    : 13px;
  font-family  : inherit;
  margin-bottom: 8px;
}
.nc-admin-modal input:focus { outline: none; border-color: var(--nc-orange); }
.nc-admin-modal input::placeholder { color: rgba(255,255,255,.3); }
.nc-admin-modal .nc-admin-error { font-size: 11px; color: #f87171; margin-top: 6px; }

/* ── Pipeline diagram (dashboard) ────────────────────────────────────────────── */
.nc-pipeline-diagram {
  display    : flex;
  align-items: center;
  gap        : 0;
  overflow-x : auto;
  padding    : 8px 0;
}
.nc-pipe-step {
  display        : flex;
  flex-direction : column;
  align-items    : center;
  gap            : 8px;
  flex-shrink    : 0;
}
.nc-pipe-circle {
  width          : 44px; height: 44px;
  border-radius  : 50%;
  background     : var(--bg);
  border         : 2px solid var(--border);
  display        : flex;
  align-items    : center;
  justify-content: center;
  font-size      : 18px;
}
.nc-pipe-circle.active { background: rgba(240,90,40,.1); border-color: var(--nc-orange); }
.nc-pipe-label { font-size: 11px; font-weight: 600; color: var(--ink3); text-align: center; max-width: 80px; }
.nc-pipe-arrow { color: var(--ink4); font-size: 18px; padding: 0 6px; margin-bottom: 22px; flex-shrink: 0; }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.nc-empty {
  text-align : center;
  padding    : 60px 24px;
  color      : var(--ink3);
}
.nc-empty .nc-empty-icon { font-size: 40px; margin-bottom: 14px; opacity: .5; }
.nc-empty h3 { font-size: 16px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.nc-empty p  { font-size: 13px; max-width: 300px; margin: 0 auto 18px; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.nc-toast {
  position     : fixed;
  bottom       : 22px; right: 22px;
  padding      : 11px 18px;
  border-radius: var(--radius);
  font-size    : 13px;
  font-weight  : 500;
  z-index      : 9999;
  box-shadow   : var(--shadow-lg);
  animation    : nc-slideup .2s ease;
  max-width    : 320px;
}
.nc-toast-success { background: var(--nc-teal); color: #fff; }
.nc-toast-error   { background: var(--red);      color: #fff; }
.nc-toast-info    { background: var(--ink);       color: #fff; }
@keyframes nc-slideup { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Prompts studio ──────────────────────────────────────────────────────────── */
.nc-prompts-layout {
  display              : grid;
  grid-template-columns: 220px 1fr;
  gap                  : 20px;
  align-items          : start;
}
.nc-prompts-list { display: flex; flex-direction: column; gap: 4px; }
.nc-prompt-list-item {
  padding      : 10px 12px;
  border-radius: var(--radius);
  font-size    : 13px;
  font-weight  : 500;
  color        : var(--ink3);
  cursor       : pointer;
  border       : 1px solid transparent;
  transition   : all .15s;
}
.nc-prompt-list-item:hover  { background: var(--bg); color: var(--ink); }
.nc-prompt-list-item.active { background: rgba(240,90,40,.07); color: var(--nc-orange); border-color: rgba(240,90,40,.2); font-weight: 600; }

.nc-prompt-desc  { font-size: 13px; color: var(--ink3); margin-bottom: 14px; line-height: 1.6; }
.nc-prompt-io    { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.nc-prompt-io-tag {
  font-size    : 11px;
  font-weight  : 600;
  padding      : 3px 8px;
  border-radius: 4px;
}
.nc-io-in  { background: var(--blue-bg);  color: var(--blue); }
.nc-io-out { background: var(--green-bg); color: var(--green); }

/* ── Settings ────────────────────────────────────────────────────────────────── */
.nc-settings-list { display: flex; flex-direction: column; gap: 12px; }
.nc-setting-row {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : 14px 16px;
  background     : var(--bg);
  border         : 1px solid var(--border);
  border-radius  : var(--radius);
  gap            : 12px;
  flex-wrap      : wrap;
}
.nc-setting-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.nc-setting-sub   { font-size: 11px; color: var(--ink4); margin-top: 2px; }
.nc-setting-status{ font-size: 12px; font-weight: 600; }
.nc-setting-status.ok   { color: var(--nc-teal); }
.nc-setting-status.warn { color: var(--amber); }
.nc-setting-status.err  { color: var(--red); }

/* ── Misc utility ────────────────────────────────────────────────────────────── */
.nc-divider   { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.nc-label-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--nc-orange); }
.nc-section-head { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.nc-manual-banner {
  background   : var(--amber-bg);
  border       : 1px solid rgba(217,119,6,.25);
  border-radius: var(--radius);
  padding      : 10px 14px;
  font-size    : 12px;
  color        : var(--amber);
  margin-bottom: 18px;
  display      : flex;
  gap          : 8px;
  align-items  : flex-start;
}

/* Admin-only elements — hidden unless role is admin or super_admin ──────────── */
.admin-only { display: none !important; }
body.is-admin .admin-only           { display: inline-flex !important; }
body.is-admin .admin-only.block     { display: block       !important; }
body.is-admin .admin-only.flex      { display: flex        !important; }
body.is-admin .admin-only.grid      { display: grid        !important; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nc-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .nc-sidebar.open { transform: translateX(0); }
  .nc-main { margin-left: 0; }
  .nc-form-row { grid-template-columns: 1fr; }
  .nc-prompts-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .nc-stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nc-page { padding: 16px; }
  .nc-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nc-stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
