/* ============================================================
   NEXX.AI — Revenue command
   Design system imported from NEXX.dc.html
   Minimalist SaaS, light/dark, serif display + grotesk + mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---- Tokens (NEXX v2 — cool neutral + emerald accent) ---- */
:root {
  --bg:#f6f7f8; --surf:#ffffff; --fg:#16181d; --mut:#5b6168; --faint:#9aa0a8;
  --line:#e6e8eb; --hair:#eef0f2; --chip:#eef1f4; --inv:#16181d; --invfg:#ffffff;
  --accent:#1f8a5b; --accsoft:#e6f4ec;
  --serif:'Source Serif 4', Georgia, serif;
  --sans:'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:'IBM Plex Mono', ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg:#0d0f12; --surf:#15181c; --fg:#e7e9ec; --mut:#969ca4; --faint:#5e646c;
  --line:#24282e; --hair:#181b1f; --chip:#1a1e24; --inv:#e7e9ec; --invfg:#0d0f12;
  --accent:#2ea16f; --accsoft:#13261d;
}

/* ---- Accents (thin colored details) ---- */
:root {
  --ac-emerald:#10b981; --ac-blue:#3b82f6; --ac-amber:#f59e0b;
  --ac-violet:#8b5cf6; --ac-rose:#f43f5e; --ac-cyan:#06b6d4;
}
.ac-emerald { --ac: var(--ac-emerald); }
.ac-blue    { --ac: var(--ac-blue); }
.ac-amber   { --ac: var(--ac-amber); }
.ac-violet  { --ac: var(--ac-violet); }
.ac-rose    { --ac: var(--ac-rose); }
.ac-cyan    { --ac: var(--ac-cyan); }

/* thin colored left rail on a card */
.nx-rail { border-left: 3px solid var(--ac, var(--line)); }
/* thin colored top line on a card */
.nx-topline { border-top: 2px solid var(--ac, var(--line)); }
/* small colored dot before a label */
.nx-dot-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ac, var(--mut)); margin-right: 7px; vertical-align: middle; }
/* (status pill colors map to neutral suffixes — kept monochrome to match the design) */
.nx-pill--ok, .nx-pill--warn, .nx-pill--info, .nx-pill--bad, .nx-pill--neutral { }

/* ---- Reset ---- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
input, select, textarea, button { font-family: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
@keyframes nx-pulse { 0% { transform: scale(.7); opacity: .8; } 70% { transform: scale(2.4); opacity: 0; } 100% { opacity: 0; } }

.nx-pulse { position: relative; width: 7px; height: 7px; display: inline-block; }
.nx-pulse::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: .25; animation: nx-pulse 2.4s ease-out infinite; }
.nx-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); }

/* ============================================================ SHELL */
.nx-shell { display: flex; width: 100%; min-height: 100vh; background: var(--bg); color: var(--fg); }

.nx-aside {
  width: 256px; flex-shrink: 0; border-right: 1px solid var(--line);
  height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column;
  background: var(--surf);
}
.nx-brand { padding: 26px 24px 20px; text-decoration: none; display: block; }
.nx-brand-row { display: flex; align-items: baseline; gap: 2px; }
.nx-brand-name { font-family: var(--serif); font-size: 25px; font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
.nx-brand-suffix { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--mut); }
.nx-brand-tag { margin: 4px 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }

.nx-workspace { margin: 0 16px 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.nx-workspace-row { display: flex; justify-content: space-between; align-items: center; }
.nx-eyebrow { margin: 0; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nx-workspace-name { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.nx-workspace-caret { color: var(--faint); font-size: 16px; }
.nx-tenant-select { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surf); color: var(--fg); font-size: 12px; padding: 7px 9px; outline: none; }
.nx-tenant-select:focus { border-color: var(--mut); }

.nx-nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.nx-nav-sec { margin-bottom: 18px; }
.nx-nav-sec-head { padding: 0 12px; margin-bottom: 7px; display: flex; align-items: baseline; justify-content: space-between; }
.nx-nav-sec-head > span:first-child { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nx-nav-sec-head > span:last-child { font-size: 10px; color: var(--faint); }
.nx-nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; cursor: pointer; text-decoration: none; margin-bottom: 1px;
  background: transparent; color: var(--mut); font-weight: 500;
}
.nx-nav-link:hover { background: var(--hair); color: var(--fg); }
.nx-nav-link.is-active { background: var(--accsoft); color: var(--accent); font-weight: 600; }
.nx-nav-glyph { width: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; opacity: .65; }
.nx-nav-glyph svg { width: 16px; height: 16px; display: block; }
.nx-nav-link.is-active .nx-nav-glyph { opacity: 1; }
.nx-nav-label { flex: 1; }
.nx-nav-badge { font-family: var(--mono); font-size: 10px; color: var(--mut); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

.nx-aside-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.nx-sys { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.nx-sys-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); font-weight: 600; }
.nx-theme-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.nx-theme-btn:hover { border-color: var(--mut); }
.nx-theme-glyph { font-family: var(--mono); font-size: 11px; color: var(--mut); }

/* ---- Body / header / main ---- */
.nx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.nx-header { min-height: 58px; flex-shrink: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--surf); }
.nx-crumb { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nx-crumb-root { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nx-crumb-sep { color: var(--faint); }
.nx-crumb-cur { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.nx-search { flex: 1; max-width: 440px; margin: 0 auto; display: flex; align-items: center; gap: 9px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.nx-search input { flex: 1; border: none; outline: none; background: transparent; color: var(--fg); font-size: 13px; }
.nx-search .kbd { font-family: var(--mono); font-size: 10px; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.nx-header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; min-width: 0; }
.nx-top-tenant { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 4px 10px 4px 4px; min-width: 218px; transition: border-color .15s ease; }
.nx-top-tenant:hover { border-color: var(--mut); }
.nx-top-tenant-avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: var(--accsoft); color: var(--accent); display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.nx-top-tenant-box { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nx-top-tenant-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; white-space: nowrap; line-height: 1; }
.nx-top-tenant select { width: 100%; min-width: 0; margin-top: 2px; border: none; outline: none; background: transparent; color: var(--fg); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; text-overflow: ellipsis; }
.nx-top-tenant-name { display: block; margin-top: 3px; color: var(--fg); font-size: 12.5px; font-weight: 700; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-top-tenant-link { flex-shrink: 0; text-decoration: none; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; color: var(--mut); background: var(--surf); font-size: 11px; font-weight: 700; }
.nx-top-tenant-link:hover { border-color: var(--mut); color: var(--fg); }
.nx-top-tenant--client { border-color: color-mix(in srgb, var(--ac-amber) 34%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 8%, var(--bg)); }
.nx-top-tenant--client .nx-top-tenant-avatar { background: color-mix(in srgb, var(--ac-amber) 16%, var(--surf)); color: var(--ac-amber); }
.nx-top-tenant-link--exit { color: var(--ac-amber); border-color: color-mix(in srgb, var(--ac-amber) 32%, var(--line)); }
.nx-wallet { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surf); }
.nx-wallet-item { display: flex; align-items: center; gap: 9px; min-width: 96px; padding: 6px 12px; border-right: 1px solid var(--hair); }
.nx-wallet-item:last-child { border-right: none; }
.nx-wallet-ic { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; background: var(--chip); color: var(--mut); display: grid; place-items: center; }
.nx-wallet-ic svg { width: 14px; height: 14px; }
.nx-wallet-meta { min-width: 0; }
.nx-wallet-meta span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; line-height: 1; }
.nx-wallet-meta strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13.5px; color: var(--fg); line-height: 1.1; white-space: nowrap; }
.nx-wallet-item--credit .nx-wallet-ic { background: var(--accsoft); color: var(--accent); }
.nx-wallet.is-low .nx-wallet-item--credit .nx-wallet-meta strong { color: var(--ac-amber); }
.nx-wallet.is-low .nx-wallet-item--credit .nx-wallet-ic { background: color-mix(in srgb, var(--ac-amber) 16%, var(--surf)); color: var(--ac-amber); }
.nx-wallet.is-empty { border-color: color-mix(in srgb, var(--ac-rose) 45%, var(--line)); }
.nx-wallet.is-empty .nx-wallet-item--credit .nx-wallet-meta strong { color: var(--ac-rose); }
.nx-wallet.is-empty .nx-wallet-item--credit .nx-wallet-ic { background: color-mix(in srgb, var(--ac-rose) 16%, var(--surf)); color: var(--ac-rose); }
.nx-refresh { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--mut); }
.nx-refresh svg { width: 16px; height: 16px; }
.nx-refresh:hover { color: var(--fg); }
.nx-user { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 100px; background: var(--bg); text-decoration: none; }
.nx-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--inv); color: var(--invfg); display: grid; place-items: center; font-size: 11px; font-weight: 700; font-family: var(--mono); }
.nx-user span:last-child { font-size: 12.5px; font-weight: 600; color: var(--fg); }

.nx-main { flex: 1; overflow-y: auto; min-width: 0; }
.nx-container { max-width: 1440px; width: 100%; min-width: 0; margin: 0 auto; padding: 22px 28px 40px; }

.nx-notice { margin-bottom: 14px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--chip); font-size: 13px; color: var(--fg); }
.nx-notice.error { border-color: var(--fg); }
.nx-notice.warn { border-color: color-mix(in srgb, var(--ac-amber) 38%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 10%, var(--surf)); }
.nx-lock-banner { margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid color-mix(in srgb, var(--ac-amber) 42%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--ac-amber) 9%, var(--surf)); padding: 13px 15px; }
.nx-lock-banner strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--fg); line-height: 1.15; }
.nx-lock-banner span { display: block; margin-top: 4px; color: var(--mut); font-size: 12.5px; line-height: 1.4; }
.nx-lock-banner .nx-btn { flex-shrink: 0; }

/* ============================================================ PRIMITIVES */
.nx-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.nx-kicker { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nx-title { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); line-height: 1.05; }
.nx-title--xl { font-size: 30px; }
.nx-sub { margin: 7px 0 0; font-size: 13.5px; color: var(--mut); max-width: 560px; line-height: 1.45; }

.nx-mono { font-family: var(--mono); }
.nx-chip { font-family: var(--mono); font-size: 11.5px; color: var(--mut); border: 1px solid var(--line); padding: 6px 11px; border-radius: 7px; display: inline-flex; align-items: center; gap: 7px; }
.nx-chip--fg { color: var(--fg); font-weight: 600; font-family: var(--sans); }
.nx-chip--live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: var(--accsoft); }
.nx-chip--muted { color: var(--mut); background: var(--chip); }

.nx-pill { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 100px; padding: 3px 10px; letter-spacing: .02em; border: 1px solid var(--line); color: var(--mut); }
.nx-pill--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.nx-pill--warn { background: #fff3d6; color: #8a4b00; border-color: #f1c46b; }

.nx-btn { border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.nx-btn:hover { border-color: var(--mut); }
.nx-btn--solid { background: var(--accent); color: #fff; border: none; font-size: 13px; padding: 11px 18px; border-radius: 9px; }
.nx-btn--solid:hover { opacity: .92; }
.nx-icon-btn { border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.nx-icon-btn:hover { border-color: var(--mut); }
.nx-icon-btn.danger:hover { border-color: var(--fg); }

/* ---- Stat strip ---- */
.nx-stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; margin-top: 16px; overflow: hidden; background: var(--surf); }
.nx-stat { padding: 13px 18px; border-right: 1px solid var(--line); }
.nx-stat:last-child { border-right: none; }
.nx-stat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nx-stat-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nx-stat-tag { font-family: var(--mono); font-size: 11px; color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.nx-stat-tag--mut { color: var(--mut); border: none; }
.nx-stat-value { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); line-height: 1; }
.nx-stat-value--xl { font-size: 30px; }
.nx-stat-value small { font-size: 19px; color: var(--mut); }
.nx-stat-caption { margin: 5px 0 0; font-size: 11.5px; color: var(--mut); }

/* ---- Section ---- */
.nx-section { margin-top: 20px; }
.nx-section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 11px; }
.nx-section-label { margin: 0 0 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nx-section-title { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--fg); }
.nx-section-stats { display: flex; gap: 22px; }
.nx-section-stats > div { text-align: right; }
.nx-section-stats p { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.nx-section-stats strong { font-family: var(--mono); font-size: 15px; color: var(--fg); }

/* ---- Panel (card) ---- */
.nx-panel { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: var(--surf); }

/* ---- Tables ---- */
.nx-table-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surf); }
.nx-table-card--inner { border-radius: 9px; }
.nx-table { width: 100%; border-collapse: collapse; }
.nx-table th { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.nx-table th.r, .nx-table td.r { text-align: right; }
.nx-table td { padding: 8px 14px; font-size: 12.5px; color: var(--fg); border-bottom: 1px solid var(--hair); vertical-align: middle; }
.nx-table tbody tr:last-child td { border-bottom: none; }
.nx-table td.mono { font-family: var(--mono); font-size: 12px; color: var(--mut); }
.nx-table td.mono-fg { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--fg); }
.nx-table td.mut { color: var(--mut); font-size: 12.5px; }
.nx-table td .name { display: block; font-size: 13px; font-weight: 600; color: var(--fg); }
.nx-table td .sub { display: block; margin-top: 1px; font-size: 11px; color: var(--faint); }
.nx-table td .sub.mono { font-family: var(--mono); }
.nx-substatus { display: block; width: fit-content; margin-top: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--mut); padding: 2px 7px; font-family: var(--mono); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.nx-substatus--active,
.nx-substatus--trial,
.nx-substatus--free,
.nx-substatus--internal { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: var(--accsoft); }
.nx-substatus--due_today,
.nx-substatus--due_soon { color: var(--ac-amber); border-color: color-mix(in srgb, var(--ac-amber) 34%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 10%, var(--surf)); }
.nx-substatus--expired,
.nx-substatus--missing { color: var(--ac-rose); border-color: color-mix(in srgb, var(--ac-rose) 34%, var(--line)); background: color-mix(in srgb, var(--ac-rose) 8%, var(--surf)); }
.nx-table-empty { text-align: center; color: var(--mut); font-size: 13px; padding: 28px 16px !important; }
.nx-table-foot { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--bg); }
.nx-table-foot span { font-size: 12px; color: var(--mut); }
.nx-table-foot a { font-size: 12px; font-weight: 600; color: var(--fg); cursor: pointer; border-bottom: 1px solid var(--fg); text-decoration: none; }

.nx-inline-select { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.nx-inline-form { display: inline; }

/* ============================================================ COCKPIT v2 */
.nx-cockpit-top { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.nx-cockpit-greet { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.nx-cockpit-headline { margin: 14px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -.015em; color: var(--fg); line-height: 1.3; max-width: 800px; }
.nx-cockpit-headline strong { font-weight: 600; }

.nx-prio { margin-top: 14px; border-top: 1px solid var(--line); }
.nx-prio-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 18px; align-items: center; padding: 15px 2px; border-bottom: 1px solid var(--hair); }
.nx-prio-rank { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--faint); line-height: 1; }
.nx-prio-title { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--fg); }
.nx-prio-ctx { margin: 3px 0 0; font-size: 12.5px; color: var(--mut); line-height: 1.45; }
.nx-prio-meta { margin: 7px 0 0; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nx-prio-verb { font-size: 12.5px; font-weight: 600; color: var(--fg); cursor: pointer; white-space: nowrap; border: 1px solid var(--line); padding: 8px 15px; border-radius: 8px; text-decoration: none; }
.nx-prio-verb:hover { background: var(--fg); color: var(--invfg); }

.nx-revbars { display: flex; align-items: flex-end; gap: 7px; height: 64px; }
.nx-revbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.nx-revbar .bar { width: 100%; background: var(--hair); border-radius: 3px; }
.nx-revbar.is-last .bar { background: var(--accent); }
.nx-revbar .lbl { font-family: var(--mono); font-size: 9px; color: var(--faint); }
.nx-revbar.is-last .lbl { color: var(--fg); }

/* ============================================================ DASHBOARD */
.nx-cockpit-grid { display: grid; grid-template-columns: 1fr 332px; gap: 16px; margin-top: 18px; align-items: start; }
.nx-cockpit-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.nx-cockpit-aside { display: flex; flex-direction: column; gap: 16px; }
.nx-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.nx-funnel { display: flex; flex-direction: column; gap: 15px; }
.nx-funnel-row { display: grid; grid-template-columns: 96px 1fr 38px; align-items: center; gap: 12px; }
.nx-funnel-row > span:first-child { font-size: 12.5px; color: var(--mut); }
.nx-funnel-track { height: 7px; background: var(--hair); border-radius: 4px; overflow: hidden; }
.nx-funnel-fill { display: block; height: 100%; background: var(--accent); }
.nx-funnel-val { font-family: var(--mono); font-size: 12px; color: var(--fg); text-align: right; }

.nx-hours { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-bottom: 22px; }
.nx-hour { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.nx-hour-bar { width: 100%; background: var(--hair); border-radius: 3px; }
.nx-hour.is-peak .nx-hour-bar { background: var(--accent); }
.nx-hour-tick { font-family: var(--mono); font-size: 9px; color: var(--faint); }
.nx-hour.is-peak .nx-hour-tick { color: var(--fg); }
.nx-hours-note { margin: 6px 0 0; font-size: 12px; color: var(--mut); }
.nx-hours-note strong { color: var(--fg); }

.nx-feed { display: flex; flex-direction: column; }
.nx-feed-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.nx-feed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg); margin-top: 6px; flex-shrink: 0; }
.nx-feed-body { flex: 1; min-width: 0; }
.nx-feed-desc { margin: 0; font-size: 13.5px; color: var(--fg); line-height: 1.4; }
.nx-feed-agent { margin: 3px 0 0; font-size: 11.5px; color: var(--faint); }
.nx-feed-time { font-family: var(--mono); font-size: 11px; color: var(--faint); flex-shrink: 0; }

.nx-side-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.nx-side-eyebrow { margin: 0 0 2px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nx-side-title { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--fg); }
.nx-side-count { font-family: var(--mono); font-size: 11px; color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; }
.nx-alert-list { display: flex; flex-direction: column; gap: 11px; }
.nx-alert { display: flex; gap: 10px; align-items: flex-start; padding-bottom: 11px; border-bottom: 1px solid var(--hair); }
.nx-alert:last-child { border-bottom: none; padding-bottom: 0; }
.nx-alert-tag { font-family: var(--mono); font-size: 10px; color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; margin-top: 1px; flex-shrink: 0; }
.nx-alert-tag--solid { color: var(--bg); background: var(--fg); border: none; }
.nx-alert p { margin: 0; font-size: 12.5px; color: var(--fg); line-height: 1.4; }
.nx-side-links { display: flex; gap: 18px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.nx-side-links a { font-size: 12px; font-weight: 600; color: var(--fg); cursor: pointer; border-bottom: 1px solid var(--fg); text-decoration: none; }

.nx-agent-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.nx-agent-row:last-child { border-bottom: none; }
.nx-agent-info { display: flex; align-items: center; gap: 10px; }
.nx-agent-info p { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.nx-agent-info span.sub { margin: 1px 0 0; font-size: 11px; color: var(--faint); display: block; }
.nx-agent-row > strong { font-family: var(--mono); font-size: 13px; color: var(--fg); }

/* ---- Compact action cards (thin) ---- */
.nx-actions-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 16px; }
.nx-act { border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: var(--surf); }
.nx-act-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nx-act-kicker { margin: 0 0 2px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nx-act-title { margin: 0; font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--fg); line-height: 1.15; }
.nx-act-row { display: flex; gap: 8px; margin-top: 9px; }
.nx-act-row textarea { flex: 1; resize: vertical; min-height: 38px; margin-top: 0; }
.nx-act-row .nx-btn--solid { flex-shrink: 0; padding: 9px 16px; }
.nx-act-result { margin-top: 9px; padding: 9px 11px; border: 1px solid var(--line); border-left: 3px solid var(--ac, var(--line)); border-radius: 8px; background: var(--bg); }
.nx-act-result strong { font-family: var(--mono); font-size: 12px; color: var(--fg); }
.nx-act-result p { margin: 3px 0 0; font-size: 12px; color: var(--mut); line-height: 1.4; }

/* ============================================================ FILTERS / TABS */
.nx-tabs { display: flex; gap: 7px; margin: 14px 0 12px; flex-wrap: wrap; }
.nx-tab { font-size: 12px; font-weight: 600; color: var(--mut); border: 1px solid var(--line); padding: 7px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.nx-tab.is-active { color: #fff; background: var(--accent); border-color: transparent; }
.nx-tab .count { opacity: .6; }

.nx-searchbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; }
.nx-searchbar .field { flex: 1; display: flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surf); }
.nx-searchbar .field span { color: var(--faint); }
.nx-searchbar .field input { flex: 1; border: none; outline: none; background: transparent; color: var(--fg); font-size: 13px; }

/* ---- Disclosure form ---- */
.nx-form-card { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surf); overflow: hidden; }
.nx-form-card > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-size: 13px; font-weight: 600; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.nx-form-card > summary::-webkit-details-marker { display: none; }
.nx-form-card > summary::before { content: "+"; font-family: var(--mono); color: var(--mut); }
.nx-form-card[open] > summary::before { content: "\2013"; }
.nx-form { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 13px; }
.nx-form .row { display: flex; gap: 13px; }
.nx-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.nx-form label { display: block; flex: 1; font-size: 11.5px; color: var(--mut); font-weight: 600; }
.nx-form label.check { display: flex; align-items: center; gap: 9px; flex-direction: row; }
.nx-field, .nx-form input, .nx-form select, .nx-form textarea {
  width: 100%; margin-top: 5px; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--fg); font-size: 13px; outline: none;
}
.nx-form input[type="checkbox"] { width: auto; margin-top: 0; }
.nx-form textarea { resize: vertical; }
.nx-form input:focus, .nx-form select:focus, .nx-form textarea:focus { border-color: var(--mut); }
.nx-form-note { margin: -3px 0 0; font-size: 12px; color: var(--mut); line-height: 1.45; }

/* ============================================================ KANBAN / CRM */
.nx-kanban { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; overflow-x: auto; padding-bottom: 8px; }
.nx-col { min-width: 180px; }
.nx-col-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 11px; border-bottom: 1px solid var(--fg); margin-bottom: 13px; }
.nx-col-head .label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg); font-weight: 700; }
.nx-col-head .count { font-family: var(--mono); font-size: 11px; color: var(--mut); }
.nx-col-body { display: flex; flex-direction: column; gap: 10px; }
.nx-lead { border: 1px solid var(--line); border-radius: 10px; padding: 13px; background: var(--surf); }
.nx-lead:hover { border-color: var(--mut); }
.nx-lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 7px; }
.nx-lead-name { margin: 0; font-size: 13px; font-weight: 600; color: var(--fg); line-height: 1.25; }
.nx-lead-level { font-family: var(--mono); font-size: 9.5px; color: var(--bg); background: var(--fg); border-radius: 4px; padding: 2px 5px; flex-shrink: 0; }
.nx-lead-phone { margin: 0 0 9px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.nx-lead-msg { margin: 0; font-size: 12px; color: var(--mut); line-height: 1.45; padding-top: 9px; border-top: 1px solid var(--hair); }
.nx-lead form { margin-top: 10px; display: flex; gap: 6px; }
.nx-lead form select { flex: 1; }
.nx-empty { font-size: 12px; color: var(--faint); padding: 14px 4px; }

/* ============================================================ CAMPAIGN / AGENT CARDS */
.nx-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.nx-card-grid--4 { grid-template-columns: repeat(4, 1fr); margin-top: 16px; }
.nx-card { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: var(--surf); display: flex; flex-direction: column; gap: 12px; }
.nx-card--sm { border-radius: 11px; padding: 14px; gap: 8px; }
.nx-card-top { display: flex; justify-content: space-between; align-items: center; }
.nx-card-mark { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--fg); }
.nx-card h3 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--fg); }
.nx-card--sm h3 { font-size: 15.5px; line-height: 1.2; }
.nx-card-meta { margin: 4px 0 0; font-size: 11.5px; color: var(--faint); }
.nx-card-desc { margin: 0; font-size: 11.5px; color: var(--mut); line-height: 1.45; flex: 1; }
.nx-card-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nx-card-mini p { margin: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.nx-card-mini strong { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.nx-card-foot-mono { margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.nx-card-tag { font-size: 10px; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 100px; padding: 2px 8px; align-self: flex-start; }

.nx-progress-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.nx-progress-head span:first-child { font-size: 11px; color: var(--mut); }
.nx-progress-head span:last-child { font-family: var(--mono); font-size: 11px; color: var(--fg); }
.nx-progress { height: 6px; background: var(--hair); border-radius: 4px; overflow: hidden; }
.nx-progress i { display: block; height: 100%; background: var(--accent); }
.nx-card-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--hair); padding-top: 12px; }
.nx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); }
.nx-dot--off { background: transparent; border: 1px solid var(--mut); }

/* ============================================================ AGENDA */
.nx-agenda { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 16px; }
.nx-agenda-day-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.nx-agenda-dow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nx-agenda-day { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--fg); }
.nx-agenda-slots { display: flex; flex-direction: column; gap: 9px; }
.nx-slot { border-radius: 9px; padding: 11px; cursor: pointer; border: 1px solid var(--line); background: var(--surf); }
.nx-slot.is-confirmed { border-color: var(--fg); background: var(--chip); }
.nx-slot-time { margin: 0 0 3px; font-family: var(--mono); font-size: 11px; color: var(--mut); }
.nx-slot-patient { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--fg); line-height: 1.25; }
.nx-slot-proc { margin: 3px 0 0; font-size: 11px; color: var(--faint); }
.nx-stepper { display: flex; align-items: center; gap: 8px; }
.nx-step-btn { font-family: var(--mono); font-size: 12px; color: var(--mut); cursor: pointer; border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); }
.nx-step-label { font-size: 13px; font-weight: 600; color: var(--fg); padding: 0 6px; }

/* ============================================================ SETTINGS */
.nx-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.nx-settings-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surf); }
.nx-settings-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; padding-bottom: 11px; border-bottom: 1px solid var(--hair); }
.nx-settings-card .fields { display: flex; flex-direction: column; gap: 13px; }
.nx-settings-card label { font-size: 11.5px; color: var(--mut); font-weight: 600; }
.nx-settings-card .nx-form-note { margin: 0; }
.nx-settings-card .nx-btn { align-self: flex-start; }
.nx-settings-card input:disabled,
.nx-settings-card select:disabled,
.nx-settings-card textarea:disabled,
.nx-settings-card button:disabled { opacity: .58; cursor: not-allowed; }
.nx-settings-panel { display: none !important; margin-top: 12px; }
.nx-settings-panel.is-active { display: block !important; }
.nx-settings-panel.nx-admin-duo.is-active { display: grid !important; }
.nx-settings-tabs .nx-tab[aria-selected="true"] { color: #fff; background: var(--accent); border-color: transparent; }
.nx-admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.nx-admin-head > div:first-child { min-width: 0; }
.nx-admin-head .nx-sub { overflow-wrap: anywhere; }
.nx-admin-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nx-admin-section-tabs { margin-top: 14px; margin-bottom: 0; }
.nx-admin-panel { display: none !important; margin-top: 12px; }
.nx-admin-panel.is-active { display: block !important; }
.nx-admin-panel.nx-admin-duo.is-active { display: grid !important; }
.nx-admin-panel--stack.is-active { display: grid !important; gap: 10px; }
.nx-admin-panel--stack .nx-price-card { margin-top: 0; }
.nx-admin-section-tabs .nx-tab[aria-selected="true"] { color: #fff; background: var(--accent); border-color: transparent; }
.nx-admin-tabs { display: flex; gap: 7px; margin-top: 13px; flex-wrap: wrap; }
.nx-admin-tabs a { text-decoration: none; font-size: 12px; font-weight: 700; color: var(--mut); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; background: var(--surf); }
.nx-admin-tabs a:hover { border-color: var(--mut); color: var(--fg); }
.nx-kpis--admin { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nx-table-card--scroll { overflow-x: auto; width: 100%; max-width: 100%; }
.nx-table--admin { min-width: 1580px; }

.nx-admin-global-context { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 4px 10px 4px 4px; min-width: 240px; }
.nx-admin-global-context span:nth-child(2) { flex: 1; min-width: 0; }
.nx-admin-global-context small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; line-height: 1; }
.nx-admin-global-context strong { display: block; margin-top: 3px; font-size: 12.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-admin-global-context em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--mut); border: 1px solid var(--line); border-radius: 7px; padding: 4px 7px; white-space: nowrap; }

/* SaaS executive command */
.nx-saas-command { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(0, 1.4fr); gap: 14px; margin-top: 16px; align-items: stretch; }
.nx-saas-score, .nx-saas-kpi, .nx-saas-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); }
.nx-saas-score { padding: 16px; display: flex; flex-direction: column; gap: 13px; }
.nx-saas-score-main { padding: 14px 0 2px; }
.nx-saas-score-main strong { display: block; font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--fg); font-weight: 600; letter-spacing: -.02em; }
.nx-saas-score-main span { display: block; margin-top: 6px; color: var(--mut); font-size: 12.5px; }
.nx-saas-score-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.nx-saas-score-meta span { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-family: var(--mono); font-size: 10.5px; color: var(--mut); background: var(--bg); }
.nx-saas-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.nx-saas-kpi { padding: 13px 14px; min-width: 0; }
.nx-saas-kpi span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.nx-saas-kpi strong { display: block; margin-top: 8px; font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--fg); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-saas-kpi p { margin: 6px 0 0; color: var(--mut); font-size: 11.5px; line-height: 1.35; }
.nx-saas-workbench { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .65fr) minmax(250px, .75fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.nx-saas-card { padding: 14px 15px; min-width: 0; }
.nx-saas-card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.nx-saas-card-head--plain { margin: 0 0 10px; }
.nx-saas-queues { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.nx-saas-queue { position: relative; min-height: 114px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.nx-saas-queue:hover, .nx-saas-queue.is-active { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accsoft); }
.nx-saas-queue .area { font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 700; }
.nx-saas-queue strong { font-size: 12.5px; line-height: 1.2; color: var(--fg); }
.nx-saas-queue .impact { font-size: 11px; color: var(--mut); line-height: 1.3; }
.nx-saas-queue b { margin-top: auto; align-self: flex-start; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.nx-rank-list { display: flex; flex-direction: column; gap: 9px; }
.nx-rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; align-items: center; }
.nx-rank-row span { font-size: 12.5px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-rank-row strong, .nx-rank-row em { font-family: var(--mono); font-size: 11.5px; color: var(--mut); font-style: normal; }
.nx-rank-rail { grid-column: 1 / -1; height: 5px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.nx-rank-rail i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.nx-saas-mini-table { display: flex; flex-direction: column; gap: 8px; }
.nx-saas-mini-row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--hair); }
.nx-saas-mini-row:last-child { border-bottom: none; padding-bottom: 0; }
.nx-saas-mini-row span { min-width: 0; }
.nx-saas-mini-row b { display: block; font-size: 12.5px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-saas-mini-row small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--faint); font-family: var(--mono); }
.nx-saas-mini-row strong { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--fg); }
.nx-saas-sublist { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.nx-saas-sublist .nx-section-label { margin-bottom: 0; }

/* Admin compact density pass */
.nx-admin-compact .nx-admin-head { padding-bottom: 10px; gap: 12px; }
.nx-admin-compact .nx-title { font-size: 24px; }
.nx-admin-compact .nx-sub { margin-top: 4px; font-size: 12.5px; }
.nx-admin-compact .nx-btn { padding: 7px 11px; }
.nx-admin-compact .nx-btn--solid { padding: 9px 13px; }
.nx-admin-compact .nx-saas-command { grid-template-columns: minmax(270px, .78fr) minmax(0, 1.55fr); gap: 10px; margin-top: 10px; }
.nx-admin-compact .nx-saas-score { padding: 11px 12px; gap: 7px; }
.nx-admin-compact .nx-saas-score .nx-kicker { margin-bottom: 2px; }
.nx-admin-compact .nx-orch-title { font-size: 18px; line-height: 1.1; }
.nx-admin-compact .nx-saas-score-main { padding: 2px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 9px; }
.nx-admin-compact .nx-saas-score-main strong { font-size: 25px; }
.nx-admin-compact .nx-saas-score-main span { margin-top: 0; font-size: 11.5px; }
.nx-admin-compact .nx-progress { height: 4px; }
.nx-admin-compact .nx-saas-score-meta { gap: 5px; }
.nx-admin-compact .nx-saas-score-meta span { padding: 3px 6px; font-size: 10px; }
.nx-admin-compact .nx-saas-kpi-grid { gap: 8px; }
.nx-admin-compact .nx-saas-kpi { padding: 9px 10px; }
.nx-admin-compact .nx-saas-kpi strong { margin-top: 5px; font-size: 18px; }
.nx-admin-compact .nx-saas-kpi p { margin-top: 3px; font-size: 10.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-admin-compact .nx-saas-workbench { gap: 10px; margin-top: 10px; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr) minmax(260px, .75fr); }
.nx-admin-compact .nx-saas-card { padding: 10px 11px; }
.nx-admin-compact .nx-saas-card-head { margin-bottom: 7px; gap: 8px; }
.nx-admin-compact .nx-section-title { font-size: 16px; }
.nx-admin-compact .nx-section-label { margin-bottom: 2px; font-size: 10px; }
.nx-admin-compact .nx-chip { padding: 4px 8px; font-size: 10.5px; }
.nx-admin-compact .nx-saas-queues { gap: 6px; }
.nx-admin-compact .nx-saas-queue { min-height: 58px; padding: 7px 8px; gap: 2px; border-radius: 8px; }
.nx-admin-compact .nx-saas-queue .area { font-size: 9px; }
.nx-admin-compact .nx-saas-queue strong { font-size: 11.5px; line-height: 1.15; }
.nx-admin-compact .nx-saas-queue .impact { display: none; }
.nx-admin-compact .nx-saas-queue b { margin-top: 2px; font-size: 12px; }
.nx-admin-compact .nx-rank-list, .nx-admin-compact .nx-saas-mini-table, .nx-admin-compact .nx-saas-sublist { gap: 6px; }
.nx-admin-compact .nx-rank-row { gap: 5px 8px; }
.nx-admin-compact .nx-rank-row span { font-size: 11.5px; }
.nx-admin-compact .nx-rank-rail { height: 4px; }
.nx-admin-compact .nx-saas-mini-row { padding-bottom: 6px; gap: 8px; }
.nx-admin-compact .nx-saas-mini-row b { font-size: 11.5px; }
.nx-admin-compact .nx-saas-mini-row small { margin-top: 1px; font-size: 10px; }
.nx-admin-compact .nx-saas-mini-row strong { font-size: 11px; }
.nx-admin-compact .nx-saas-sublist { margin-top: 9px; padding-top: 8px; }
.nx-admin-compact .nx-orch-control { gap: 10px; margin-top: 10px; grid-template-columns: minmax(0, 1fr) 350px; }
.nx-admin-compact .nx-orch-cohorts { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 6px; }
.nx-admin-compact .nx-orch-cohort { min-height: 42px; padding: 7px 9px; border-radius: 8px; }
.nx-admin-compact .nx-orch-cohort span { font-size: 11.5px; }
.nx-admin-compact .nx-orch-cohort strong { font-size: 12px; }
.nx-admin-compact .nx-orch-attention { padding: 10px 11px; }
.nx-admin-compact .nx-orch-attention-head { margin-bottom: 6px; gap: 8px; }
.nx-admin-compact .nx-orch-alerts { gap: 4px; }
.nx-admin-compact .nx-orch-alert { padding: 6px 0 6px 8px; gap: 7px; }
.nx-admin-compact .nx-orch-alert strong { font-size: 11.5px; }
.nx-admin-compact .nx-orch-alert span { margin-top: 1px; font-size: 10.5px; }
.nx-admin-compact .nx-section { margin-top: 14px; }
.nx-admin-compact .nx-section-head { margin-bottom: 8px; }
.nx-admin-compact .nx-admin-toolbar { margin-bottom: 8px; }
.nx-admin-compact .nx-admin-search { padding: 7px 10px; }
.nx-admin-compact .nx-table--admin th { padding: 6px 10px; }
.nx-admin-compact .nx-table--admin td { padding: 6px 10px; font-size: 12px; }

/* SaaS orchestration */
.nx-orch { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 14px; margin-top: 16px; align-items: stretch; }
.nx-orch-main, .nx-orch-metrics, .nx-orch-attention { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); }
.nx-orch-main { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.nx-orch-title { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.015em; color: var(--fg); line-height: 1.15; }
.nx-orch-copy { margin: 7px 0 0; max-width: 690px; color: var(--mut); font-size: 13px; line-height: 1.45; }
.nx-orch-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.nx-orch-step { border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; }
.nx-orch-step span { display: block; font-family: var(--mono); font-size: 10px; color: var(--faint); margin-bottom: 5px; }
.nx-orch-step strong { display: block; font-size: 12.5px; color: var(--fg); }
.nx-orch-step p { margin: 4px 0 0; font-size: 11.5px; color: var(--mut); line-height: 1.35; }
.nx-orch-metrics { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.nx-orch-metric { padding: 14px 15px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); min-width: 0; }
.nx-orch-metric:nth-child(2n) { border-right: none; }
.nx-orch-metric:nth-last-child(-n+2) { border-bottom: none; }
.nx-orch-metric span { display: block; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nx-orch-metric strong { display: block; margin-top: 7px; font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--fg); line-height: 1; }
.nx-orch-metric p { margin: 5px 0 0; font-size: 11.5px; color: var(--mut); line-height: 1.3; }
.nx-orch-control { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; margin-top: 14px; align-items: start; }
.nx-orch-cohorts { display: grid; grid-template-columns: repeat(4, minmax(128px, 1fr)); gap: 8px; }
.nx-orch-cohort { min-height: 58px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); color: var(--fg); padding: 10px 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nx-orch-cohort:hover { border-color: var(--mut); }
.nx-orch-cohort.is-active { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: var(--accsoft); color: var(--accent); }
.nx-orch-cohort span { font-size: 12px; font-weight: 700; color: inherit; }
.nx-orch-cohort strong { font-family: var(--mono); font-size: 13px; color: inherit; }
.nx-orch-attention { padding: 13px 15px; }
.nx-orch-attention-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.nx-orch-alerts { display: flex; flex-direction: column; gap: 7px; }
.nx-orch-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-left: 3px solid var(--line); padding: 9px 0 9px 10px; border-bottom: 1px solid var(--hair); }
.nx-orch-alert:last-child { border-bottom: none; }
.nx-orch-alert.is-critical { border-left-color: var(--ac-rose); }
.nx-orch-alert.is-attention { border-left-color: var(--ac-amber); }
.nx-orch-alert.is-healthy { border-left-color: var(--accent); }
.nx-orch-alert strong { display: block; font-size: 12.5px; color: var(--fg); line-height: 1.2; }
.nx-orch-alert span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--mut); line-height: 1.35; }
.nx-health { display: grid; grid-template-columns: 56px auto; align-items: center; gap: 7px; min-width: 116px; }
.nx-health::before { content: ""; grid-column: 1; grid-row: 1; height: 5px; border-radius: 4px; background: var(--hair); }
.nx-health i { grid-column: 1; grid-row: 1; display: block; height: 5px; border-radius: 4px; background: var(--accent); max-width: 100%; }
.nx-health b { font-size: 11.5px; color: var(--mut); font-weight: 700; }
.nx-health--critical i { background: var(--ac-rose); }
.nx-health--critical b { color: var(--ac-rose); }
.nx-health--attention i { background: var(--ac-amber); }
.nx-health--attention b { color: var(--ac-amber); }

/* admin toolbar (search + count) */
.nx-admin-toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.nx-admin-search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surf); }
.nx-admin-search svg { width: 15px; height: 15px; color: var(--faint); flex-shrink: 0; }
.nx-admin-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--fg); font-size: 13px; }
.nx-admin-count { font-size: 12px; color: var(--mut); white-space: nowrap; }
.nx-admin-count b { font-family: var(--mono); color: var(--fg); font-weight: 600; }

/* sticky table header inside a scroll card */
.nx-table--sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--surf); }
.nx-table--admin tbody tr:hover td { background: var(--hair); }

/* saldo badge */
.nx-saldo { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--fg); }
.nx-saldo.is-low { color: var(--ac-amber); }
.nx-saldo.is-empty { color: var(--ac-rose); }

/* per-row actions */
.nx-row-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.nx-row-actions .nx-icon-btn { padding: 6px; line-height: 0; }
.nx-row-actions .nx-icon-btn svg { width: 15px; height: 15px; }
.nx-btn:disabled { opacity: .58; cursor: not-allowed; }

/* forms inside modals: drop the disclosure padding, let gap handle spacing */
.nx-modal-card .nx-form { padding: 0; gap: 12px; }
.nx-modal-card .nx-form label { margin-bottom: 0; }
.nx-modal-card .nx-form .row { flex-wrap: wrap; }
.nx-modal-card .nx-form .row > label { min-width: 130px; }
.nx-modal-card .nx-modal-foot { margin-top: 4px; }
.nx-admin-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; align-items: start; }
.nx-admin-action { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); overflow: hidden; }
.nx-admin-action > summary { list-style: none; cursor: pointer; padding: 12px 15px; border-bottom: 1px solid transparent; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; }
.nx-admin-action > summary::-webkit-details-marker { display: none; }
.nx-admin-action > summary span { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--fg); }
.nx-admin-action > summary small { font-size: 11px; color: var(--faint); font-weight: 600; text-align: right; }
.nx-admin-action > summary::after { content: "+"; font-family: var(--mono); font-size: 13px; color: var(--mut); }
.nx-admin-action[open] > summary::after { content: "-"; }
.nx-admin-action[open] > summary { border-bottom-color: var(--hair); }
.nx-admin-action .nx-form { padding: 14px 16px 16px; }
.nx-admin-duo { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; align-items: start; }
.nx-audit-card { overflow-x: auto; }
.nx-audit-card table { min-width: 620px; }
.nx-audit-head { padding: 13px 15px 10px; border-bottom: 1px solid var(--line); background: var(--surf); }
.nx-price-card { margin-top: 18px; }
.nx-price-card > .nx-table-card { border-left: none; border-right: none; border-bottom: none; border-radius: 0; }
.nx-toggle { width: 34px; height: 20px; border-radius: 100px; background: var(--line); position: relative; flex-shrink: 0; transition: background .15s; }
.nx-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transition: left .15s; }
.nx-switch input:checked + .nx-toggle { background: var(--fg); }
.nx-switch input:checked + .nx-toggle::after { left: 16px; }
.nx-switch input { position: absolute; opacity: 0; pointer-events: none; }
.nx-switch { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--fg); position: relative; }

/* ============================================================ COMERCIAL (master/detail) */
.lvl-HOT  { --ac: var(--ac-rose); }
.lvl-WARM { --ac: var(--ac-amber); }
.lvl-COLD { --ac: var(--ac-cyan); }

.nx-cmd { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }

.nx-queue { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); display: flex; flex-direction: column; max-height: calc(100vh - 210px); overflow: hidden; }
.nx-queue-tabs { display: flex; gap: 6px; padding: 9px; border-bottom: 1px solid var(--line); }
.nx-queue-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--mut); border: 1px solid var(--line); border-radius: 7px; padding: 6px 4px; cursor: pointer; }
.nx-queue-tab.is-active { background: var(--inv); color: var(--invfg); border-color: transparent; }
.nx-queue-tab .c { font-family: var(--mono); opacity: .7; }
.nx-queue-search { display: flex; align-items: center; gap: 8px; margin: 9px 9px 0; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.nx-queue-search span { color: var(--faint); font-size: 13px; }
.nx-queue-search input { flex: 1; border: none; outline: none; background: transparent; color: var(--fg); font-size: 12.5px; }
.nx-queue-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.nx-queue-empty { padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--faint); }
.nx-crm-badge { font-size: 10px; border: 1px solid var(--line); border-radius: 100px; padding: 1px 7px; color: var(--mut); }

.nx-lead-item { border: 1px solid var(--line); border-left: 3px solid var(--ac, var(--line)); border-radius: 10px; padding: 10px 11px; cursor: pointer; background: var(--surf); }
.nx-lead-item:hover { border-color: var(--mut); }
.nx-lead-item.is-active { background: var(--chip); box-shadow: inset 0 0 0 1px var(--ac, var(--fg)); }
.nx-lead-item .top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.nx-lead-item .nm { font-size: 13px; font-weight: 600; color: var(--fg); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-lvl { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 5px; padding: 2px 6px; border: 1px solid var(--ac, var(--line)); color: var(--ac, var(--mut)); flex-shrink: 0; }
.nx-lead-item .msg { font-size: 11.5px; color: var(--mut); line-height: 1.4; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-lead-item .meta { display: flex; gap: 10px; font-size: 10.5px; color: var(--faint); font-family: var(--mono); }

.nx-detail { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); min-height: 340px; position: sticky; top: 0; align-self: start; }
.nx-detail-empty { display: grid; place-items: center; min-height: 340px; color: var(--mut); font-size: 13px; }
.nx-detail-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.nx-detail-id { display: flex; align-items: center; gap: 12px; }
.nx-detail-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--inv); color: var(--invfg); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.nx-detail-name { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--fg); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.nx-detail-contact { margin: 4px 0 0; font-size: 12.5px; color: var(--mut); font-family: var(--mono); }
.nx-detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; align-items: center; }
.nx-detail-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.nx-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.nx-kpi { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg); }
.nx-kpi p { margin: 0; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.nx-kpi strong { display: block; margin-top: 4px; font-size: 13px; color: var(--fg); }
.nx-next { border: 1px solid var(--line); border-left: 3px solid var(--ac, var(--ac-emerald)); border-radius: 10px; padding: 13px 15px; background: var(--bg); }
.nx-next .lbl { margin: 0 0 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 600; }
.nx-next .act { margin: 0; font-size: 14px; font-weight: 600; color: var(--fg); line-height: 1.4; }
.nx-next .ctx { margin: 6px 0 0; font-size: 12.5px; color: var(--mut); line-height: 1.45; }
.nx-crm-inline { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; background: var(--bg); }
.nx-crm-inline span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Modal ---- */
.nx-modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; }
.nx-modal.is-open { display: flex; }
.nx-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.38); }
.nx-modal-card { position: relative; z-index: 1; width: min(460px, 100%); background: var(--surf); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow-y: auto; }
.nx-modal-card--wide { width: min(620px, 100%); }
.nx-modal-title { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--fg); }
.nx-modal-desc { margin: 5px 0 16px; font-size: 12.5px; color: var(--mut); line-height: 1.45; }
.nx-modal-card label { display: block; font-size: 11.5px; color: var(--mut); font-weight: 600; margin-bottom: 12px; }
.nx-modal-card .row { display: flex; gap: 10px; }
.nx-modal-card .row > label { flex: 1; }
.nx-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.nx-fast-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nx-fast-form > label:first-child:nth-last-child(3) { grid-column: span 2; }
.nx-modal-quick { display: flex; flex-wrap: wrap; gap: 7px; margin: -2px 0 2px; }
.nx-modal-quick button { border: 1px solid var(--line); border-radius: 100px; background: var(--bg); color: var(--fg); font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 6px 10px; cursor: pointer; }
.nx-modal-quick button:hover { border-color: var(--mut); background: var(--chip); }
.nx-modal-details { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.nx-modal-details > summary { list-style: none; cursor: pointer; padding: 10px 12px; color: var(--fg); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nx-modal-details > summary::-webkit-details-marker { display: none; }
.nx-modal-details > summary::after { content: "+"; font-family: var(--mono); color: var(--mut); }
.nx-modal-details[open] > summary { border-bottom: 1px solid var(--line); }
.nx-modal-details[open] > summary::after { content: "-"; }
.nx-modal-details > .nx-fast-form, .nx-modal-details > label { padding: 11px 12px 0; }
.nx-modal-details > label:last-child { padding-bottom: 12px; }
.nx-modal-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 13px; }
.nx-modal-summary span { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 8px 10px; color: var(--mut); font-size: 10.5px; }
.nx-modal-summary b { display: block; color: var(--fg); font-family: var(--mono); font-size: 12px; line-height: 1.2; margin-bottom: 2px; }
.nx-result-box { margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line); border-left: 3px solid var(--ac-blue); border-radius: 9px; background: var(--bg); font-size: 12.5px; color: var(--fg); line-height: 1.45; display: none; }
.nx-result-box.is-shown { display: block; }
.nx-seg { display: inline-flex; gap: 6px; }
.nx-seg button { flex: 1; }

/* ---- Right drawer (conversa + analises) ---- */
.nx-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.20); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
.nx-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.nx-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(640px, 96vw); background: var(--surf); border-left: 1px solid var(--line); box-shadow: -16px 0 50px rgba(0,0,0,.20); z-index: 56; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,1,.36,1); display: flex; flex-direction: column; }
.nx-drawer.is-open { transform: translateX(0); }
.nx-drawer.is-wide { width: min(840px, 97vw); }
.nx-drawer-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.nx-drawer-head .k { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 600; }
.nx-drawer-head h4 { margin: 2px 0 0; font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--fg); }
.nx-drawer-tabs { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; overflow-x: auto; }
.nx-drawer-tab { white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--mut); border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px; cursor: pointer; background: var(--surf); }
.nx-drawer-tab.is-active { background: var(--inv); color: var(--invfg); border-color: transparent; }
.nx-drawer-close { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.nx-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 18px; display: flex; flex-direction: column; gap: 12px; }

.nx-an-card { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: var(--bg); }
.nx-an-card.accent { border-left: 3px solid var(--ac, var(--ac-blue)); }
.nx-an-card .t { margin: 0 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.nx-an-card p { margin: 0; font-size: 13px; color: var(--fg); line-height: 1.5; }
.nx-an-card p.mut { color: var(--mut); margin-top: 6px; }
.nx-an-card ul { margin: 0; padding-left: 16px; }
.nx-an-card li { font-size: 13px; color: var(--fg); line-height: 1.55; }
.nx-an-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--hair); }
.nx-an-row:last-child { border-bottom: none; }
.nx-an-row span { color: var(--mut); } .nx-an-row strong { color: var(--fg); }

/* chat */
.nx-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.nx-chat-note { margin: 12px 14px 0; border: 1px solid color-mix(in srgb, var(--ac-amber) 35%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 10%, var(--surf)); border-radius: 9px; padding: 8px 11px; font-size: 11.5px; color: var(--mut); }
.nx-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; background: var(--bg); }
.nx-day { align-self: center; font-size: 11px; color: var(--mut); background: var(--chip); border-radius: 100px; padding: 3px 11px; margin: 4px 0; }
.nx-bubble { max-width: 78%; border-radius: 13px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.nx-bubble .tm { display: block; margin-top: 4px; font-size: 10px; color: var(--faint); font-family: var(--mono); text-align: right; }
.nx-bubble.in { align-self: flex-start; background: var(--chip); border: 1px solid var(--line); color: var(--fg); }
.nx-bubble.out { align-self: flex-end; background: color-mix(in srgb, var(--ac-emerald) 16%, var(--surf)); border: 1px solid color-mix(in srgb, var(--ac-emerald) 32%, var(--line)); color: var(--fg); }
.nx-bubble.out .tm { color: color-mix(in srgb, var(--ac-emerald) 60%, var(--mut)); }
.nx-chat-empty { text-align: center; color: var(--mut); font-size: 13px; padding: 40px 14px; }
.nx-composer { border-top: 1px solid var(--line); padding: 11px 14px; display: flex; gap: 8px; background: var(--surf); flex-shrink: 0; }
.nx-composer input { flex: 1; border: 1px solid var(--line); border-radius: 100px; padding: 9px 15px; background: var(--bg); color: var(--fg); font-size: 13px; outline: none; }
.nx-composer input:focus { border-color: var(--mut); }
.nx-composer button { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--inv); color: var(--invfg); cursor: pointer; font-size: 15px; flex-shrink: 0; }
.nx-reanalyze-strip { margin: 0 14px; padding: 8px 11px; border-radius: 9px; background: color-mix(in srgb, var(--ac-blue) 10%, var(--surf)); border: 1px solid color-mix(in srgb, var(--ac-blue) 30%, var(--line)); font-size: 12px; color: var(--fg); }

@media (max-width: 820px) { .nx-drawer, .nx-drawer.is-wide { width: 100vw; } }

/* ============================================================ SUPORTE */
.nx-help-link.is-active { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: var(--accsoft); color: var(--accent); }
.nx-help-link span { font-size: 12px; }

.nx-support-widget { position: fixed; right: 22px; bottom: 22px; z-index: 54; }
.nx-support-fab { width: 54px; height: 54px; border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line)); border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 18px 42px -22px color-mix(in srgb, var(--accent) 80%, transparent); position: relative; }
.nx-support-fab svg { width: 22px; height: 22px; }
.nx-support-fab span { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ac-amber); color: #fff; border: 2px solid var(--surf); font-family: var(--mono); font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.nx-support-panel { position: absolute; right: 0; bottom: 66px; width: min(390px, calc(100vw - 28px)); max-height: min(680px, calc(100vh - 110px)); border: 1px solid var(--line); border-radius: 14px; background: var(--surf); box-shadow: 0 22px 70px -34px rgba(0,0,0,.42); overflow: hidden; display: none; }
.nx-support-widget.is-open .nx-support-panel { display: flex; flex-direction: column; }
.nx-support-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid var(--line); background: var(--surf); }
.nx-support-head h3 { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--fg); }
.nx-support-state { flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--mut); background: var(--chip); }
.nx-support-state.is-online { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: var(--accsoft); }
.nx-support-state.is-offline { color: var(--ac-amber); border-color: color-mix(in srgb, var(--ac-amber) 36%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 10%, var(--surf)); }
.nx-support-body { min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.nx-support-faq-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 10px 11px; }
.nx-support-faq-mini p { margin: 0 0 3px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nx-support-faq-mini strong { display: block; font-size: 12.5px; color: var(--fg); line-height: 1.25; }
.nx-support-faq-mini a { flex-shrink: 0; font-size: 11.5px; color: var(--accent); font-weight: 800; text-decoration: none; }
.nx-support-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.nx-support-quick a { text-decoration: none; font-size: 11px; font-weight: 700; color: var(--mut); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; background: var(--surf); }
.nx-support-quick a:hover { color: var(--fg); border-color: var(--mut); }
.nx-support-thread { display: flex; flex-direction: column; gap: 8px; max-height: 210px; overflow-y: auto; padding: 2px; }
.nx-support-msg { max-width: min(78%, 560px); border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; background: var(--bg); }
.nx-support-msg b { display: block; font-size: 11px; color: var(--fg); margin-bottom: 4px; }
.nx-support-msg p { margin: 0; font-size: 12.5px; color: var(--mut); line-height: 1.45; }
.nx-support-msg .tm { display: block; margin-top: 5px; font-family: var(--mono); font-size: 9.5px; color: var(--faint); text-align: right; }
.nx-support-msg--user { align-self: flex-start; background: var(--chip); border-color: var(--line); }
.nx-support-msg--support { align-self: flex-end; background: var(--accsoft); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.nx-support-msg--support b,
.nx-support-msg--support p { color: var(--fg); }
.nx-support-msg--internal { align-self: stretch; max-width: 100%; background: color-mix(in srgb, var(--ac-amber) 8%, var(--surf)); border-style: dashed; border-color: color-mix(in srgb, var(--ac-amber) 35%, var(--line)); }
.nx-support-msg--internal b::after { content: " · interno"; color: var(--ac-amber); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.nx-support-form { border-top: 1px solid var(--hair); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.nx-support-form textarea,
.nx-support-form input,
.nx-support-form select,
.nx-support-page-form input,
.nx-support-page-form select,
.nx-support-page-form textarea { width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); padding: 8px 10px; outline: none; font-size: 12.5px; }
.nx-support-form textarea:focus,
.nx-support-form input:focus,
.nx-support-form select:focus,
.nx-support-page-form input:focus,
.nx-support-page-form select:focus,
.nx-support-page-form textarea:focus { border-color: var(--mut); }
.nx-support-row label,
.nx-support-details label { font-size: 11px; color: var(--mut); font-weight: 700; }
.nx-support-details { border: 1px solid var(--line); border-radius: 9px; background: var(--bg); overflow: hidden; }
.nx-support-details summary { list-style: none; cursor: pointer; padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--fg); display: flex; justify-content: space-between; }
.nx-support-details summary::-webkit-details-marker { display: none; }
.nx-support-details summary::after { content: "+"; font-family: var(--mono); color: var(--mut); }
.nx-support-details[open] summary::after { content: "-"; }
.nx-support-details label { display: block; padding: 0 10px 9px; }
.nx-support-form .nx-btn { justify-content: center; width: 100%; padding: 9px 12px; }
.nx-support-form .nx-btn:disabled { opacity: .62; cursor: wait; }

.nx-support-page-head { align-items: center; }
.nx-support-head-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nx-support-head-stats span { border: 1px solid var(--line); border-radius: 9px; background: var(--surf); padding: 8px 11px; font-size: 11px; color: var(--mut); }
.nx-support-head-stats b { font-family: var(--mono); color: var(--fg); font-size: 13px; }
.nx-support-hero { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surf); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 14px; align-items: center; }
.nx-support-hero h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--fg); }
.nx-support-hero p:not(.nx-section-label) { margin: 6px 0 0; color: var(--mut); font-size: 13px; line-height: 1.45; max-width: 720px; }
.nx-support-search { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 9px 12px; }
.nx-support-search svg { width: 16px; height: 16px; color: var(--faint); flex-shrink: 0; }
.nx-support-search input { width: 100%; border: none; background: transparent; outline: none; color: var(--fg); font-size: 13px; }
.nx-support-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; margin-top: 14px; align-items: start; }
.nx-help-list { display: grid; gap: 11px; }
.nx-help-topic { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); overflow: hidden; }
.nx-help-topic-head { padding: 14px 15px 12px; border-bottom: 1px solid var(--hair); }
.nx-help-topic-head span { display: inline-flex; margin-bottom: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--mut); font-size: 10.5px; font-weight: 800; }
.nx-help-topic-head h3 { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--fg); }
.nx-help-topic-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--mut); line-height: 1.45; }
.nx-help-questions details { border-top: 1px solid var(--hair); }
.nx-help-questions details:first-child { border-top: none; }
.nx-help-questions summary { cursor: pointer; list-style: none; padding: 12px 15px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; color: var(--fg); }
.nx-help-questions summary::-webkit-details-marker { display: none; }
.nx-help-questions summary::after { content: "+"; flex-shrink: 0; font-family: var(--mono); color: var(--mut); }
.nx-help-questions details[open] summary::after { content: "-"; }
.nx-help-questions p { margin: -4px 15px 13px; color: var(--mut); font-size: 12.5px; line-height: 1.5; }
.nx-help-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; color: var(--mut); text-align: center; }
.nx-support-side { position: sticky; top: 0; display: grid; gap: 12px; }
.nx-support-card { overflow: hidden; }
.nx-support-page-form { padding: 13px 15px 15px; }
.nx-support-page-form .nx-btn { align-self: flex-start; }
.nx-ticket-list { display: grid; max-height: 420px; overflow-y: auto; }
.nx-ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--hair); }
.nx-ticket-row:first-child { border-top: none; }
.nx-ticket-row strong { display: block; margin-top: 6px; color: var(--fg); font-size: 12.8px; line-height: 1.3; }
.nx-ticket-row p { margin: 4px 0 0; color: var(--mut); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-ticket-row > span { color: var(--faint); font-size: 10.5px; white-space: nowrap; }
.nx-ticket-status--open { color: var(--ac-amber); border-color: color-mix(in srgb, var(--ac-amber) 45%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 10%, var(--surf)); }
.nx-ticket-status--in_progress { color: var(--ac-blue); border-color: color-mix(in srgb, var(--ac-blue) 38%, var(--line)); background: color-mix(in srgb, var(--ac-blue) 9%, var(--surf)); }
.nx-ticket-status--waiting_user { color: var(--ac-violet); border-color: color-mix(in srgb, var(--ac-violet) 38%, var(--line)); background: color-mix(in srgb, var(--ac-violet) 9%, var(--surf)); }
.nx-ticket-status--waiting_internal { color: var(--ac-rose); border-color: color-mix(in srgb, var(--ac-rose) 34%, var(--line)); background: color-mix(in srgb, var(--ac-rose) 8%, var(--surf)); }
.nx-ticket-status--resolved { color: var(--accent); border-color: transparent; background: var(--accsoft); }
.nx-admin-duo--support { grid-template-columns: 1fr; }
.nx-support-admin-card { overflow-x: auto; }
.nx-support-admin-card table { min-width: 940px; }
.nx-support-admin-note { margin: 5px 0 0; max-width: 620px; color: var(--mut); font-size: 12px; line-height: 1.4; }
.nx-support-live-thread { display: flex; flex-direction: column; gap: 8px; min-height: 160px; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 10px; margin: 10px 0 12px; }
.nx-support-live-thread .nx-chat-empty { padding: 26px 10px; }

/* ---- Customer support center ---- */
.nx-customer-center-head { align-items: center; }
.nx-customer-center-head .nx-title { font-size: 22px; line-height: 1; }
.nx-customer-center-head .nx-row-actions { align-items: center; gap: 8px; }
.nx-kpis.nx-support-kpis { margin-top: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* Cards uniformes: o destaque "Fila ativa" mantém a cor mas não ocupa 2 colunas */
.nx-support-kpis .nx-kpi--hero { grid-column: auto; }
.nx-support-kpis .nx-kpi--hero .nx-kpi-v { font-size: 23px; }
.nx-support-workspace-tabs { display: inline-flex; align-items: center; gap: 3px; margin-top: 0; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); }
.nx-support-workspace-tabs button { border: 0; border-radius: 7px; background: transparent; color: var(--mut); font-size: 11.5px; font-weight: 800; padding: 6px 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.nx-support-workspace-tabs button b { min-width: 20px; border-radius: 999px; background: var(--chip); color: var(--fg); padding: 2px 6px; font-family: var(--mono); font-size: 10px; text-align: center; }
.nx-support-workspace-tabs button.is-active { background: var(--accent); color: #fff; }
.nx-support-workspace-tabs button.is-active b { background: rgba(255,255,255,.22); color: #fff; }
.nx-service-console { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 12px; margin-top: 10px; height: min(620px, calc(100vh - 330px)); min-height: 520px; align-items: stretch; }
.nx-channel-pane,
.nx-conversation-pane,
.nx-center-playbook { min-width: 0; height: 100%; }
.nx-channel-pane,
.nx-conversation-pane { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); overflow: hidden; }
.nx-channel-pane { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.nx-channel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); }
.nx-channel-head h2 { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--fg); }
.nx-channel-search { margin: 10px 12px 8px; width: calc(100% - 24px); max-width: none; }
.nx-center-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); background: var(--surf); }
.nx-center-filters button { border: 1px solid var(--line); border-radius: 999px; background: var(--surf); color: var(--mut); font-size: 11.5px; font-weight: 700; padding: 5px 10px; cursor: pointer; }
.nx-center-filters button.is-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: var(--accsoft); }
.nx-channel-list { display: block; min-height: 0; overflow-y: auto; }
.nx-channel-workspace { display: flex; flex-direction: column; min-height: 0; }
.nx-channel-workspace[hidden] { display: none !important; }
.nx-channel-item { width: 100%; flex: 0 0 auto; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 9px; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--hair); background: transparent; text-align: left; cursor: pointer; color: inherit; }
.nx-channel-item:hover,
.nx-channel-item.is-active { background: var(--bg); }
.nx-channel-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.nx-channel-avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accsoft); color: var(--accent); }
.nx-channel-avatar--ticket { background: color-mix(in srgb, var(--ac-amber) 10%, var(--surf)); color: var(--ac-amber); }
.nx-channel-avatar svg { width: 16px; height: 16px; }
.nx-channel-body { min-width: 0; display: grid; align-content: start; gap: 2px; }
.nx-channel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.nx-channel-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.8px; color: var(--fg); }
.nx-channel-top small { flex-shrink: 0; color: var(--faint); font-family: var(--mono); font-size: 10px; }
.nx-channel-status { display: block; min-height: 18px; }
.nx-channel-status .nx-pill { font-size: 9.5px; padding: 2px 6px; line-height: 1.15; }
.nx-channel-body strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-size: 11.8px; font-weight: 700; }
.nx-channel-body small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-family: var(--mono); font-size: 10px; }
.nx-channel-tags { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.nx-channel-tags i { flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surf); color: var(--mut); font-size: 9.5px; font-style: normal; font-weight: 800; padding: 2px 6px; }
.nx-sla--warn { color: var(--ac-amber) !important; border-color: color-mix(in srgb, var(--ac-amber) 38%, var(--line)) !important; background: color-mix(in srgb, var(--ac-amber) 9%, var(--surf)) !important; }
.nx-sla--overdue { color: var(--ac-rose) !important; border-color: color-mix(in srgb, var(--ac-rose) 36%, var(--line)) !important; background: color-mix(in srgb, var(--ac-rose) 8%, var(--surf)) !important; }
.nx-sla--waiting { color: var(--ac-violet) !important; border-color: color-mix(in srgb, var(--ac-violet) 34%, var(--line)) !important; background: color-mix(in srgb, var(--ac-violet) 8%, var(--surf)) !important; }
.nx-channel-body em { min-width: 0; color: var(--mut); font-size: 11.5px; line-height: 1.35; font-style: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-conversation-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.nx-conversation-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: var(--surf); }
.nx-conversation-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; color: var(--fg); }
.nx-conversation-head span { display: block; margin-top: 4px; color: var(--mut); font-size: 12px; }
.nx-conversation-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.nx-center-mode { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); gap: 2px; }
.nx-center-mode button { border: 0; border-radius: 7px; background: transparent; color: var(--mut); font-size: 11.5px; font-weight: 800; padding: 6px 10px; cursor: pointer; }
.nx-center-mode button.is-active { background: var(--surf); color: var(--fg); box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.nx-center-panel { min-height: 0; overflow: hidden; background: var(--bg); }
.nx-center-panel[hidden] { display: none !important; }
.nx-center-panel.is-active { display: block; }
.nx-center-thread { min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.nx-center-panel .nx-center-thread { height: 100%; }
.nx-ticket-mode-panel { padding: 14px; overflow-y: auto; }
.nx-ticket-problem { border: 1px solid var(--line); border-radius: 10px; background: var(--surf); padding: 13px 14px; margin-bottom: 10px; }
.nx-ticket-problem span,
.nx-ticket-detail-grid span,
.nx-ticket-note span { display: block; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nx-ticket-problem h3 { margin: 6px 0 0; color: var(--fg); font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.2; }
.nx-ticket-problem p { margin: 9px 0 0; color: var(--fg); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.nx-ticket-problem small { display: block; margin-top: 8px; color: var(--mut); font-family: var(--mono); font-size: 10.5px; }
.nx-ticket-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.nx-ticket-detail-grid article { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surf); padding: 10px 11px; }
.nx-ticket-detail-grid strong { display: block; margin-top: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-size: 13px; }
.nx-ticket-note { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); padding: 11px 12px; }
.nx-ticket-note p { margin: 7px 0 0; color: var(--fg); font-size: 13px; line-height: 1.45; }
.nx-ticket-solve-box { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); padding: 11px 12px; }
.nx-ticket-solve-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.nx-ticket-solve-head span { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nx-ticket-solve-head p { margin: 0; color: var(--mut); font-size: 11.5px; line-height: 1.35; text-align: right; max-width: 430px; }
.nx-ticket-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 9px; margin-top: 10px; }
.nx-ticket-edit-grid label { min-width: 0; color: var(--mut); font-size: 11px; font-weight: 800; }
.nx-ticket-edit-grid .nx-field { margin-top: 5px; }
.nx-ticket-save-inline { min-height: 41px; border: 1px solid var(--line); border-radius: 8px; background: var(--surf); color: var(--fg); padding: 8px 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
.nx-ticket-save-inline:hover { border-color: var(--mut); background: var(--bg); }
.nx-ticket-save-inline[disabled] { opacity: .55; cursor: wait; }
.nx-ticket-safe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nx-ticket-safe-actions button { border: 1px solid var(--line); border-radius: 8px; background: var(--surf); color: var(--fg); padding: 8px 11px; font-size: 12px; font-weight: 800; cursor: pointer; }
.nx-ticket-safe-actions button:hover { border-color: var(--mut); background: var(--bg); }
.nx-ticket-safe-actions button[disabled] { opacity: .55; cursor: wait; }
.nx-internal-note-box,
.nx-ticket-audit-box { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); padding: 11px 12px; }
.nx-internal-note-box > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.nx-internal-note-box span,
.nx-ticket-audit-head span { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nx-internal-note-box p { margin: 0; color: var(--mut); font-size: 11.5px; }
.nx-internal-note-box textarea { width: 100%; min-height: 62px; resize: vertical; }
.nx-internal-note-box .nx-btn { margin-top: 8px; }
.nx-ticket-audit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nx-ticket-audit-head small { color: var(--mut); font-size: 11px; }
.nx-ticket-audit-list { display: grid; gap: 7px; margin-top: 8px; max-height: 156px; overflow-y: auto; }
.nx-ticket-audit-list p { margin: 0; color: var(--mut); font-size: 12px; }
.nx-audit-event { border-top: 1px solid var(--hair); padding-top: 7px; display: grid; gap: 2px; }
.nx-audit-event:first-child { border-top: 0; padding-top: 0; }
.nx-audit-event strong { color: var(--fg); font-size: 12px; }
.nx-audit-event span { color: var(--mut); font-size: 11.5px; line-height: 1.35; }
.nx-context-panel { padding: 14px; overflow-y: auto; }
.nx-context-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.nx-context-grid article { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surf); padding: 11px 12px; }
.nx-context-grid span { display: block; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nx-context-grid strong { display: block; min-width: 0; margin-top: 6px; color: var(--fg); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-ticket-permission-note { margin: 10px 0 0; border: 1px dashed color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: 10px; background: var(--accsoft); color: var(--mut); padding: 10px 12px; font-size: 12px; line-height: 1.45; }
.nx-center-composer { display: grid; grid-template-columns: 165px minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border-top: 1px solid var(--line); background: var(--surf); }
.nx-center-composer label { font-size: 11px; color: var(--mut); font-weight: 700; }
.nx-center-composer { align-items: end; }
.nx-center-composer .nx-field { margin-top: 5px; height: 40px; }
.nx-center-composer .nx-btn { height: 40px; }
.nx-center-reply textarea { min-height: 0; height: 40px; resize: none; overflow-y: auto; line-height: 1.4; }
.nx-center-playbook { display: block; overflow-y: auto; padding-right: 2px; }
.nx-center-playbook > .nx-table-card + .nx-table-card { margin-top: 12px; }
.nx-support-playbook { list-style: none; margin: 0; padding: 0 14px 14px; display: grid; gap: 0; }
.nx-support-playbook li { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--hair); }
.nx-support-playbook li:first-child { border-top: none; }
.nx-support-playbook b { display: block; font-size: 12.2px; color: var(--fg); line-height: 1.25; }
.nx-support-playbook span { display: block; color: var(--mut); font-size: 11.8px; line-height: 1.4; }
.nx-reply-templates { display: grid; gap: 7px; padding: 12px 14px 14px; }
.nx-reply-templates button { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); padding: 8px 10px; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.nx-reply-templates button:hover { border-color: var(--mut); }

@media (max-width: 980px) {
  .nx-support-hero,
  .nx-support-layout,
  .nx-service-console { grid-template-columns: 1fr; }
  .nx-support-side { position: static; }
  .nx-kpis.nx-support-kpis { grid-template-columns: repeat(2, 1fr); }
  .nx-service-console { height: auto; min-height: 0; }
  .nx-channel-list { max-height: 360px; min-height: 0; }
  .nx-conversation-pane { min-height: 560px; }
  .nx-center-composer { grid-template-columns: 1fr; }
  .nx-ticket-detail-grid,
  .nx-context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .nx-support-widget { right: 14px; bottom: 14px; }
  .nx-support-panel { right: -6px; bottom: 62px; }
  .nx-help-link span { display: none; }
  .nx-support-head-stats { justify-content: flex-start; }
  .nx-ticket-row { grid-template-columns: 1fr; }
  .nx-kpis.nx-support-kpis { grid-template-columns: 1fr; }
  .nx-customer-center-head { align-items: flex-start; flex-direction: column; }
  .nx-conversation-head,
  .nx-conversation-actions { align-items: flex-start; flex-direction: column; }
  .nx-ticket-detail-grid,
  .nx-ticket-edit-grid,
  .nx-context-grid { grid-template-columns: 1fr; }
}

/* ============================================================ COCKPIT v3 (refresh) */
.nx-cockpit-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 16px; margin-bottom: 0; border-bottom: 1px solid var(--line); }
.nx-cockpit-title { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); line-height: 1.05; }
.nx-hero-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* KPI cards */
.nx-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.nx-kpi-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; background: var(--surf); display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 4px; align-items: center; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.nx-kpi-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 26px -16px color-mix(in srgb, var(--accent) 60%, transparent); }
.nx-kpi-card .top { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; align-self: center; }
.nx-kpi-card .val { grid-column: 1; grid-row: 1; align-self: end; }
.nx-kpi-card > div:not(.top) { grid-column: 1; grid-row: 2; align-self: start; }
.nx-kpi-card .ic { width: 27px; height: 27px; border-radius: 8px; background: var(--accsoft); color: var(--accent); display: grid; place-items: center; }
.nx-kpi-card .ic svg { width: 14px; height: 14px; }
.nx-kpi-delta { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; background: var(--accsoft); color: var(--accent); font-family: var(--mono); }
.nx-kpi-tag { font-family: var(--mono); font-size: 10px; color: var(--mut); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.nx-kpi-card .val { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); line-height: 1; }
.nx-kpi-card .val small { font-size: 15px; color: var(--mut); font-weight: 600; }
.nx-kpi-card .lbl { margin: 0; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nx-kpi-card .cap { margin: 1px 0 0; font-size: 11px; color: var(--mut); line-height: 1.3; }

/* Campaign rate emphasis */
.nx-table td.rate-good { color: var(--accent); font-weight: 700; font-family: var(--mono); }
.nx-table td.rate-low { color: var(--ac-rose); font-weight: 700; font-family: var(--mono); }
.nx-pill--on { background: var(--accsoft); color: var(--accent); border-color: transparent; font-weight: 700; }
.nx-pill--internal { color: var(--ac-blue); border-color: color-mix(in srgb, var(--ac-blue) 36%, var(--line)); background: color-mix(in srgb, var(--ac-blue) 9%, var(--surf)); }

/* Agent health meter rows */
.nx-agent2 { padding: 11px 0; border-bottom: 1px solid var(--hair); }
.nx-agent2:last-child { border-bottom: none; padding-bottom: 0; }
.nx-agent2 .head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.nx-agent2 .head p { margin: 0; flex: 1; font-size: 12.5px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-agent2 .head strong { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.nx-agent-meter { height: 6px; background: var(--hair); border-radius: 4px; overflow: hidden; }
.nx-agent-meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.nx-agent2 .sub { display: block; margin-top: 6px; font-size: 11px; color: var(--faint); font-family: var(--mono); }

@media (max-width: 1100px) { .nx-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .nx-kpis { grid-template-columns: 1fr; } .nx-cockpit-hero { flex-direction: column; align-items: flex-start; } }
@media (max-width: 560px) {
  .nx-orch-steps, .nx-orch-cohorts, .nx-orch-metrics { grid-template-columns: 1fr; }
  .nx-orch-metric { border-right: none; }
  .nx-orch-metric:nth-last-child(-n+2) { border-bottom: 1px solid var(--hair); }
  .nx-orch-metric:last-child { border-bottom: none; }
  .nx-admin-toolbar { align-items: stretch; flex-direction: column; }
  .nx-admin-search { max-width: none; width: 100%; }
}

/* ============================================================ COMERCIAL refresh */
/* line icons inside buttons */
.nx-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.nx-btn--sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.nx-btn--sm svg { width: 14px; height: 14px; }

/* compact commercial header */
.nx-cmd-head { padding-bottom: 14px; }
.nx-cmd-head-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nx-cmd-sum { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.nx-cmd-sum b { color: var(--fg); font-weight: 700; }
.nx-tab-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* queue: taller now that the stat strip is gone, denser cards */
.nx-queue { max-height: calc(100vh - 156px); }
.nx-queue-search svg { width: 15px; height: 15px; color: var(--faint); flex-shrink: 0; }
.nx-queue-tab { gap: 5px; }
.nx-lead-item { padding: 9px 11px; }
.nx-lead-item .msg { margin: 0 0 5px; }

/* detail: side-panel block */
.nx-detail { min-height: 300px; }
.nx-detail-panel { border-top: 1px solid var(--hair); padding-top: 13px; }
.nx-detail-panel-label { margin: 0 0 9px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 600; }
.nx-detail-panel-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.nx-detail-panel-row .nx-btn { justify-content: flex-start; }
.nx-detail-panel-row .nx-btn svg { color: var(--ac, var(--mut)); }
#dSugWrap .act { color: var(--fg); }

.nx-drawer-close svg { width: 15px; height: 15px; }
.nx-composer button svg { width: 17px; height: 17px; }

@media (max-width: 820px) {
  .nx-cmd-head-side { flex-wrap: wrap; gap: 8px; }
  .nx-detail-panel-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ CAMPANHAS refresh */
.nx-card { transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.nx-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 26px -18px color-mix(in srgb, var(--accent) 55%, transparent); }
.nx-card-mini strong.up { color: var(--accent); }
.nx-icon-btn { display: inline-flex; align-items: center; gap: 6px; }
.nx-icon-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* compact campaign cards (rebuilt) */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(316px, 1fr)); gap: 12px; }
.camp { border: 1px solid var(--line); border-radius: 11px; background: var(--surf); padding: 12px 13px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.camp:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 24px -18px color-mix(in srgb, var(--accent) 55%, transparent); }
.camp-head { display: flex; align-items: center; gap: 10px; }
.camp-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accsoft); color: var(--accent); display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.camp-id { flex: 1; min-width: 0; }
.camp-name { margin: 0; font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--fg); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-meta { margin: 2px 0 0; font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp .nx-pill { flex-shrink: 0; }
.camp-prog { display: flex; align-items: center; gap: 10px; }
.camp-prog .nx-progress { flex: 1; height: 5px; }
.camp-prog-val { font-family: var(--mono); font-size: 10.5px; color: var(--mut); flex-shrink: 0; min-width: 30px; text-align: right; }
.camp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--hair); }
.camp-stats { display: flex; gap: 14px; }
.camp-stats span { font-size: 10.5px; color: var(--faint); }
.camp-stats b { font-family: var(--mono); font-size: 12.5px; color: var(--fg); font-weight: 600; margin-right: 3px; }
.camp-stats b.up { color: var(--accent); }
.camp-actions { display: flex; gap: 6px; flex-shrink: 0; }
.camp-actions .nx-icon-btn { padding: 5px 9px; font-size: 11.5px; }
.camp-err { margin: 0; font-size: 10.5px; color: var(--ac-rose); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================ CRM refresh */
.nx-kanban { gap: 12px; grid-template-columns: repeat(6, minmax(168px, 1fr)); }
.crm-card { border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: var(--surf); cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.crm-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-1px); box-shadow: 0 8px 20px -16px color-mix(in srgb, var(--accent) 55%, transparent); }
.crm-card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.crm-card-name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-card-phone { margin: 0 0 6px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.crm-card-msg { margin: 0; font-size: 11px; color: var(--mut); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-card:active { cursor: grabbing; }
.crm-card.dragging { opacity: .4; }
.nx-col-body { min-height: 48px; }
.nx-col-body.drop-over { background: var(--accsoft); outline: 1px dashed var(--accent); outline-offset: -2px; border-radius: 8px; }

.crm-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.crm-modal-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--inv); color: var(--invfg); display: grid; place-items: center; font-family: var(--mono); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.crm-modal-phone { margin: 3px 0 0; font-family: var(--mono); font-size: 12px; color: var(--mut); }
.crm-modal-msg { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; padding: 11px 13px; background: var(--bg); font-size: 12.5px; color: var(--fg); line-height: 1.5; margin-bottom: 14px; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1260px) {
  .nx-search { max-width: 280px; }
  .nx-top-tenant { min-width: 178px; }
  .nx-wallet-item { min-width: 78px; }
  .nx-saas-command, .nx-saas-workbench { grid-template-columns: 1fr; }
  .nx-saas-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-saas-queues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .nx-cockpit-grid { grid-template-columns: 1fr; }
  .nx-card-grid, .nx-duo, .nx-admin-duo { grid-template-columns: 1fr 1fr; }
  .nx-card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .nx-agenda { grid-template-columns: repeat(2, 1fr); }
  .nx-admin-actions { grid-template-columns: 1fr; }
  .nx-admin-action:nth-child(3) { grid-column: auto; }
  .nx-kpis--admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-orch, .nx-orch-control { grid-template-columns: 1fr; }
  .nx-orch-cohorts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .nx-cmd { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .nx-aside { display: none; }
  .nx-header { min-height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .nx-crumb { width: 100%; }
  .nx-header-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .nx-lock-banner { align-items: flex-start; flex-direction: column; }
  .nx-lock-banner .nx-btn { width: 100%; justify-content: center; }
  .nx-top-tenant { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .nx-admin-global-context { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .nx-wallet { grid-column: 1 / -1; min-width: 0; }
  .nx-wallet-item { min-width: 0; flex: 1; }
  .nx-header-actions > .nx-btn { justify-content: center; width: 100%; }
  .nx-user { padding-right: 6px; }
  .nx-user { justify-content: center; width: 100%; padding: 5px; }
  .nx-user span:last-child { display: none; }
  .nx-stat-strip { grid-template-columns: 1fr 1fr; }
  .nx-card-grid, .nx-duo, .nx-card-grid--4, .nx-settings-grid, .nx-agenda, .nx-admin-duo, .nx-field-grid, .nx-kpis--admin { grid-template-columns: 1fr; }
  .nx-admin-head { align-items: flex-start; flex-direction: column; }
  .nx-admin-head > div { min-width: 0; max-width: 100%; }
  .nx-admin-head, .nx-admin-head > div:first-child, .nx-admin-head .nx-sub { width: 100%; max-width: calc(100vw - 36px); }
  .nx-admin-head-actions { justify-content: flex-start; }
  .nx-admin-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .nx-saas-kpi-grid { grid-template-columns: 1fr 1fr; }
  .nx-saas-queues { grid-template-columns: 1fr 1fr; }
  .nx-orch-steps, .nx-orch-cohorts { grid-template-columns: 1fr 1fr; }
  .nx-orch-metrics { grid-template-columns: 1fr 1fr; }
  .nx-orch-attention-head { align-items: flex-start; flex-direction: column; }
  .nx-orch-alert { align-items: flex-start; flex-direction: column; }
  .nx-orch-alert .nx-btn { width: 100%; justify-content: center; }
  .nx-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .nx-section-stats { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 14px; }
  .nx-section-stats > div { text-align: left; }
  .nx-sub { max-width: 100%; }
  .nx-cmd { grid-template-columns: 1fr; }
  .nx-queue { max-height: 320px; }
  .nx-kpi-row { grid-template-columns: 1fr 1fr; }
  .nx-search { display: none; }
  .nx-container { padding: 24px 18px 48px; }
}

@media (max-width: 560px) {
  .nx-orch-steps, .nx-orch-cohorts, .nx-orch-metrics { grid-template-columns: 1fr; }
  .nx-saas-kpi-grid, .nx-saas-queues { grid-template-columns: 1fr; }
  .nx-saas-score-main strong { font-size: 27px; }
  .nx-fast-form, .nx-modal-summary { grid-template-columns: 1fr; }
  .nx-fast-form > label:first-child:nth-last-child(3) { grid-column: auto; }
  .nx-modal-card { padding: 16px; }
}

@media (max-width: 1260px) {
  .nx-admin-compact .nx-saas-command,
  .nx-admin-compact .nx-saas-workbench,
  .nx-admin-compact .nx-orch-control { grid-template-columns: 1fr; }
  .nx-admin-compact .nx-saas-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-admin-compact .nx-saas-queues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .nx-admin-compact .nx-saas-kpi-grid,
  .nx-admin-compact .nx-saas-queues,
  .nx-admin-compact .nx-orch-cohorts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .nx-admin-compact .nx-saas-kpi-grid,
  .nx-admin-compact .nx-saas-queues,
  .nx-admin-compact .nx-orch-cohorts { grid-template-columns: 1fr; }
  .nx-admin-compact .nx-saas-score-main strong { font-size: 24px; }
}

/* ============================================================ ADMIN SAAS — refinements
   KPI accents, onboarding empty state, sortable table, totals footer */

/* KPI cards: thin colored top rail + lift on hover (accent via .ac-* → --ac) */
.nx-saas-kpi { position: relative; overflow: hidden; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.nx-saas-kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--ac, var(--accent)); opacity: .9; }
.nx-saas-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ac, var(--accent)) 45%, var(--line)); box-shadow: 0 10px 26px -18px color-mix(in srgb, var(--ac, var(--accent)) 60%, transparent); }
.nx-saas-kpi strong { color: var(--fg); }

/* Onboarding / empty state inside the score card */
.nx-saas-onboard { display: flex; flex-direction: column; gap: 9px; padding: 4px 0 2px; }
.nx-saas-onboard-lead { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--fg); line-height: 1.2; }
.nx-saas-onboard-copy { margin: 0; font-size: 12px; color: var(--mut); line-height: 1.45; }
.nx-saas-onboard-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.nx-saas-onboard-steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mut); border: 1px solid var(--line); border-radius: 100px; padding: 4px 10px 4px 4px; background: var(--bg); }
.nx-saas-onboard-steps b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accsoft); color: var(--accent); font-family: var(--mono); font-size: 10px; }
.nx-saas-onboard .nx-btn--solid { align-self: flex-start; }

/* Sortable column headers */
.nx-sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s ease; }
.nx-sortable:hover { color: var(--mut); }
.nx-sortable::after { content: "\2195"; margin-left: 5px; font-family: var(--mono); font-size: 9px; opacity: .35; }
.nx-sortable[aria-sort="ascending"]::after { content: "\2191"; opacity: 1; }
.nx-sortable[aria-sort="descending"]::after { content: "\2193"; opacity: 1; }
.nx-sortable[aria-sort="ascending"], .nx-sortable[aria-sort="descending"] { color: var(--fg); }
.nx-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Totals footer */
.nx-table-totals td { padding: 9px 14px; font-size: 12px; border-top: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.nx-admin-compact .nx-table-totals td { padding: 7px 10px; }
.nx-table-totals td:first-child { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--faint); }
.nx-table--sticky tfoot td { position: sticky; bottom: 0; z-index: 2; }

/* Rich empty state (no tenants) */
.nx-table-empty-rich { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 8px; }
.nx-table-empty-rich strong { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--fg); }
.nx-table-empty-rich span { font-size: 12.5px; color: var(--mut); max-width: 420px; line-height: 1.45; }
.nx-table-empty-rich .nx-btn { margin-top: 3px; }

/* Modal: focus ring + smooth entrance */
.nx-modal.is-open .nx-modal-card { animation: nx-modal-in .18s cubic-bezier(.22,1,.36,1); }
@keyframes nx-modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.nx-modal-card :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- Compact carteira filter chips (replaces the bulky cohort grid) ---- */
.nx-cohort-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.nx-cohort-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--mut); border: 1px solid var(--line); background: var(--surf); border-radius: 100px; padding: 5px 6px 5px 12px; cursor: pointer; line-height: 1; white-space: nowrap; transition: border-color .12s ease, color .12s ease, background .12s ease; }
.nx-cohort-chip:hover { border-color: var(--mut); color: var(--fg); }
.nx-cohort-chip b { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--fg); background: var(--chip); border-radius: 100px; padding: 2px 7px; min-width: 20px; text-align: center; }
.nx-cohort-chip.is-active { background: var(--accent); border-color: transparent; color: #fff; }
.nx-cohort-chip.is-active b { background: rgba(255,255,255,.22); color: #fff; }
.nx-cohort-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nx-admin-compact .nx-cohort-bar { margin-bottom: 10px; }

/* ---- Saldo / tokens / saúde badges in the table header ---- */
.nx-portfolio-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.nx-portfolio-stats span { display: inline-flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 7px 13px; min-width: 92px; }
.nx-portfolio-stats i { font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.nx-portfolio-stats b { font-family: var(--mono); font-size: 14px; color: var(--fg); font-weight: 600; line-height: 1; }
.nx-portfolio-stats .ok b { color: var(--accent); }
.nx-portfolio-stats .bad b { color: var(--ac-amber); }

/* ---- Single-column control band + extra density on admin ---- */
.nx-orch-control--single,
.nx-admin-compact .nx-orch-control--single { grid-template-columns: 1fr; }
.nx-admin-compact .nx-admin-duo { margin-top: 10px; gap: 10px; }
.nx-admin-compact .nx-price-card { margin-top: 10px; }
.nx-admin-compact .nx-saas-command { margin-top: 8px; }
.nx-admin-compact .nx-saas-workbench { margin-top: 8px; }
.nx-admin-compact .nx-orch-control { margin-top: 8px; }
.nx-admin-compact .nx-section { margin-top: 10px; }

@media (max-width: 560px) {
  .nx-portfolio-stats { width: 100%; }
  .nx-portfolio-stats span { flex: 1; min-width: 0; }
  .nx-cohort-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}

/* ---- Top band: kill empty vertical space, balance the distribution ----
   KPIs become a 2×2 grid that fills the score-card height with vertically
   centered content, so the cards no longer stretch into blank gaps. */
.nx-admin-compact .nx-saas-kpi-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; }
.nx-admin-compact .nx-saas-kpi { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 11px 13px; }
.nx-admin-compact .nx-saas-kpi strong { margin-top: 0; font-size: 19px; }
.nx-admin-compact .nx-saas-kpi p { white-space: normal; margin-top: 2px; }

/* Compact onboarding so the score card (which drives the band height) is shorter */
.nx-admin-compact .nx-saas-onboard { gap: 6px; padding: 2px 0 0; }
.nx-saas-onboard-lead { font-size: 15px; }
.nx-saas-onboard-copy { font-size: 11.5px; }
.nx-saas-onboard-steps { margin: 1px 0 2px; }
.nx-admin-compact .nx-saas-onboard .nx-btn--solid { padding: 7px 12px; font-size: 12px; }

/* Workbench cards take their natural height instead of stretching to the tallest */
.nx-admin-compact .nx-saas-workbench { align-items: start; }
.nx-admin-compact .nx-saas-queue { min-height: 52px; }

/* Audit tables (ledger + token usage) side-by-side on wide screens — big height saving */
.nx-admin-compact .nx-admin-duo { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; align-items: start; }
@media (max-width: 1100px) { .nx-admin-compact .nx-admin-duo { grid-template-columns: 1fr; } }

/* Subtle lift on the workbench cards, matching the KPI/campaign cards */
.nx-saas-card { transition: border-color .15s ease, box-shadow .15s ease; }
.nx-saas-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: 0 8px 22px -18px color-mix(in srgb, var(--accent) 55%, transparent); }

/* Workbench trimmed to two cards (Filas internas removed) */
.nx-admin-compact .nx-saas-workbench--duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 820px) { .nx-saas-workbench--duo { grid-template-columns: 1fr; } }

/* Clients table: bounded vertical scroll as the portfolio grows; horizontal scroll
   as a safety net so the actions column is never clipped on narrow widths.
   Header and totals stay pinned while the rows scroll inside the card. */
.nx-table-card--vscroll { max-height: 560px; overflow-y: auto; overflow-x: auto; }
.nx-table-card--vscroll table { width: 100%; table-layout: auto; }
.nx-table-card--vscroll tbody tr:hover td { background: var(--hair); }
.nx-table-card--vscroll td .sub { white-space: nowrap; }
.nx-admin-compact .nx-table-card--vscroll th { padding: 7px 10px; }
.nx-admin-compact .nx-table-card--vscroll td { padding: 7px 10px; font-size: 12px; }

/* ---- Company board: separate KPI cards + chart + queues ---- */
.nx-board { margin-top: 10px; }
.nx-board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.nx-board-head .nx-section-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.nx-board-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.nx-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-emerald); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac-emerald) 70%, transparent); animation: nx-pulse 2.2s infinite; }
@keyframes nx-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac-emerald) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.nx-ck-tag { font-size: 10.5px; color: var(--mut); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.nx-ck-tag b { font-family: var(--mono); color: var(--fg); font-weight: 600; }

/* KPI tiles: compactos, auto-fit */
.nx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.nx-kpi { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surf); padding: 12px 13px; min-width: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.nx-kpi:hover { border-color: color-mix(in srgb, var(--ac, var(--accent)) 30%, var(--line)); box-shadow: 0 8px 22px -18px color-mix(in srgb, var(--ac, var(--accent)) 60%, transparent); }
.nx-kpi-k { display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-kpi-k .dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; background: var(--ac, var(--accent)); }
.nx-kpi-v { margin-top: 7px; font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.02em; line-height: 1; color: var(--fg); white-space: nowrap; }
.nx-kpi-foot { margin-top: 6px; font-size: 10px; color: var(--faint); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-kpi--hero { grid-column: span 2; background: color-mix(in srgb, var(--ac-emerald) 5%, var(--surf)); border-color: color-mix(in srgb, var(--ac-emerald) 22%, var(--line)); }
.nx-kpi--hero .nx-kpi-v { color: var(--ac-emerald); font-size: 25px; }
.nx-kpi--hero .nx-kpi-foot { white-space: normal; overflow: visible; text-overflow: clip; }

/* Second board row: chart card + queues card */
.nx-board-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.nx-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surf); padding: 13px 15px; min-width: 0; }

/* Chart card */
.nx-ck-delta { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ac-emerald); background: var(--accsoft); border-radius: 5px; padding: 2px 6px; }
.nx-ck-delta.is-down { color: var(--ac-rose); background: color-mix(in srgb, var(--ac-rose) 12%, var(--surf)); }
.nx-ck-plot { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; min-height: 250px; }
.nx-ck-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 28px 0 25px; border-right: 1px solid var(--hair); }
.nx-ck-axis span { font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; }
.nx-ck-body { position: relative; min-width: 0; border-radius: 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--hair) 32%, transparent), transparent 62%); }
.nx-ck-grid { position: absolute; inset: 28px 10px 25px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.nx-ck-grid i { display: block; height: 1px; background: var(--hair); }
.nx-ck-bars { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 18px; height: 250px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.nx-ck-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; min-width: 64px; }
.nx-ck-value { height: 16px; font-family: var(--mono); font-size: 10.5px; font-weight: 800; color: var(--fg); white-space: nowrap; line-height: 1; padding: 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--surf) 82%, transparent); border: 1px solid var(--hair); }
.nx-ck-value.is-zero { color: var(--faint); font-weight: 600; }
.nx-ck-stack { width: 100%; max-width: 58px; height: calc(100% - 43px); display: flex; flex-direction: column; justify-content: flex-end; border-radius: 8px 8px 0 0; overflow: hidden; box-shadow: 0 10px 18px -16px color-mix(in srgb, var(--fg) 55%, transparent); }
.nx-ck-stack i { display: block; width: 100%; transition: height .35s cubic-bezier(.4,0,.2,1); }
.nx-ck-stack i.rec { background: linear-gradient(180deg, color-mix(in srgb, var(--ac-emerald) 88%, #fff), var(--ac-emerald)); }
.nx-ck-stack i.proj { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--mut) 38%, var(--hair)) 0 7px, color-mix(in srgb, var(--mut) 24%, var(--hair)) 7px 14px); }
.nx-ck-stack i.mk { background: var(--ac-violet); border-radius: 8px 8px 0 0; }
.nx-ck-bar.is-empty .nx-ck-stack { height: 3px; background: var(--hair); border-radius: 2px; }
.nx-ck-bar span { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.nx-ck-bar.is-current span { color: var(--fg); font-weight: 700; }
.nx-ck-bar.is-future span { color: var(--mut); }
.nx-ck-chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.nx-ck-chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--mut); border: 1px solid var(--hair); border-radius: 999px; padding: 4px 9px; background: color-mix(in srgb, var(--surf) 76%, transparent); }
.nx-ck-chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.nx-ck-chart-legend .rec i { background: var(--ac-emerald); }
.nx-ck-chart-legend .proj i { background: color-mix(in srgb, var(--mut) 42%, var(--hair)); }
.nx-ck-chart-legend .mk i { background: var(--ac-violet); }
.nx-chart-card { display: flex; flex-direction: column; min-height: 335px; }
.nx-chart-empty { flex: 1; justify-content: center; min-height: 120px; }

/* Centro de ações (substitui as pílulas de fila) */
.nx-actions { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nx-action { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.nx-action:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); background: var(--bg); }
.nx-action-count { flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--faint); background: var(--chip); }
.nx-action-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nx-action-body b { font-size: 12.5px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-action-body small { font-size: 10.5px; color: var(--faint); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-action-go { flex-shrink: 0; display: grid; place-items: center; color: var(--faint); opacity: 0; transform: translateX(-3px); transition: opacity .15s ease, transform .15s ease; }
.nx-action-go svg { width: 15px; height: 15px; }
.nx-action:hover .nx-action-go { opacity: 1; transform: translateX(0); }
/* Filas com pendência: chamam atenção */
.nx-action.is-hot { border-color: color-mix(in srgb, var(--ac-amber) 45%, var(--line)); background: color-mix(in srgb, var(--ac-amber) 7%, var(--surf)); }
.nx-action.is-hot .nx-action-count { color: var(--invfg); background: var(--ac-amber); }
.nx-action.is-hot .nx-action-go { color: var(--ac-amber); }
/* Filas zeradas: discretas (nada a fazer) */
.nx-action:not(.is-hot) .nx-action-body b { color: var(--mut); }
.nx-action:not(.is-hot) { opacity: .72; }
.nx-action:not(.is-hot):hover { opacity: 1; }
/* Fila selecionada (filtro ativo na tabela) */
.nx-action.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surf)); opacity: 1; }
.nx-action.is-active .nx-action-count { color: var(--invfg); background: var(--accent); }

.nx-admin-compact .nx-kpi { padding: 11px 12px; }
.nx-admin-compact .nx-kpi-v { font-size: 22px; }
.nx-admin-compact .nx-kpi--hero .nx-kpi-v { font-size: 23px; }
.nx-admin-compact .nx-kpi-foot { font-size: 9px; margin-top: 5px; }
.nx-admin-compact .nx-kpis { gap: 9px; }
.nx-admin-compact .nx-board-row { gap: 9px; margin-top: 9px; }
.nx-admin-compact .nx-board-head { margin-bottom: 11px; }

@media (max-width: 1024px) { .nx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .nx-board-row { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .nx-kpis { grid-template-columns: 1fr; } .nx-kpi--hero { grid-column: auto; } }

/* ---- Analytics row: donut / leaders / gauge ---- */
.nx-analytics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; margin-top: 12px; }
.nx-an-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surf); padding: 16px 18px; min-width: 0; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.nx-an-card:hover { border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); box-shadow: 0 14px 34px -24px color-mix(in srgb, var(--accent) 65%, transparent); transform: translateY(-2px); }
.nx-an-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.nx-an-head .nx-section-label { margin: 0; }
.nx-an-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 8px; color: var(--faint); }
.nx-an-empty svg { width: 26px; height: 26px; opacity: .6; }
.nx-an-empty span { font-size: 11.5px; line-height: 1.4; max-width: 220px; }

/* Mix de planos: barras horizontais */
.nx-barlist { display: flex; flex-direction: column; gap: 13px; }
.nx-barrow { min-width: 0; }
.nx-barrow-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.nx-barrow-top span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-barrow-top span i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.nx-barrow-top b { flex-shrink: 0; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--fg); }
.nx-barrow-top b em { font-style: normal; color: var(--faint); font-size: 10.5px; }
.nx-barrow-rail { height: 8px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.nx-barrow-rail i { display: block; height: 100%; border-radius: 4px; transition: width .4s cubic-bezier(.4,0,.2,1); }

/* Leaders */
.nx-leader-list { display: flex; flex-direction: column; gap: 12px; }
.nx-leader { display: flex; align-items: center; gap: 11px; min-width: 0; }
.nx-leader-rank { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--mut); background: var(--chip); }
.nx-leader:first-child .nx-leader-rank { color: var(--invfg); background: var(--ac-emerald); }
.nx-leader-body { flex: 1; min-width: 0; }
.nx-leader-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nx-leader-top b { font-size: 12.5px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-leader-top strong { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--fg); }
.nx-leader-rail { height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; margin-top: 6px; }
.nx-leader-rail i { display: block; height: 100%; border-radius: 3px; background: var(--ac-emerald); transition: width .4s cubic-bezier(.4,0,.2,1); }

.nx-admin-compact .nx-analytics { gap: 9px; margin-top: 9px; }
.nx-admin-compact .nx-an-card { padding: 12px 13px; }
.nx-admin-compact .nx-an-head { margin-bottom: 12px; }

@media (max-width: 700px) { .nx-analytics { grid-template-columns: 1fr; } }

/* ---- Markup cell badge + header tag ---- */
.nx-markup { font-family: var(--mono); font-size: 12px; color: var(--fg); font-weight: 600; }
.nx-markup-tag { display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 5px; padding: 1px 6px; border: 1px solid var(--line); }
.nx-markup-tag.is-default { color: var(--accent); background: var(--accsoft); border-color: transparent; }
.nx-markup-tag.is-custom { color: var(--ac-amber); background: color-mix(in srgb, var(--ac-amber) 14%, var(--surf)); border-color: transparent; }
.nx-btn-tag { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accsoft); border-radius: 5px; padding: 1px 6px; }

/* ---- Monthly-fee history list ---- */
.nx-fee-history { display: flex; flex-direction: column; padding: 4px 12px 12px; max-height: 220px; overflow-y: auto; }
.nx-fee-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.nx-fee-row:last-child { border-bottom: none; }
.nx-fee-row span { min-width: 0; display: flex; flex-direction: column; }
.nx-fee-row b { font-size: 12.5px; color: var(--fg); }
.nx-fee-row small { margin-top: 2px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.nx-fee-row strong { flex-shrink: 0; font-family: var(--mono); font-size: 12.5px; color: var(--fg); }

/* ---- Plans / tenant users ---- */
.nx-seat { display: grid; grid-template-columns: minmax(54px, auto) 56px; align-items: center; gap: 8px; min-width: 116px; }
.nx-seat span { font-family: var(--mono); font-size: 12px; color: var(--mut); white-space: nowrap; }
.nx-seat b { color: var(--fg); font-weight: 700; }
.nx-seat::before { content: ""; grid-column: 2; grid-row: 1; height: 5px; border-radius: 4px; background: var(--hair); }
.nx-seat i { grid-column: 2; grid-row: 1; display: block; height: 5px; max-width: 100%; border-radius: 4px; background: var(--accent); }
.nx-seat.is-full i { background: var(--ac-amber); }
.nx-seat.is-full b { color: var(--ac-amber); }
.nx-admin-compact .nx-admin-duo--access { grid-template-columns: 1fr; }
.nx-admin-duo--access { align-items: stretch; }
.nx-access-card { overflow-x: hidden; min-width: 0; }
.nx-access-card table { width: 100%; min-width: 0; table-layout: fixed; }
.nx-access-table th,
.nx-access-table td { padding: 7px 9px; font-size: 11.7px; overflow-wrap: anywhere; }
.nx-access-table th { font-size: 9.5px; letter-spacing: .06em; }
.nx-access-table td .name { font-size: 12.4px; }
.nx-access-table td .sub { font-size: 10px; white-space: normal; }
.nx-plan-table th:nth-child(1), .nx-plan-table td:nth-child(1) { width: 22%; }
.nx-plan-table th:nth-child(2), .nx-plan-table td:nth-child(2) { width: 13%; }
.nx-plan-table th:nth-child(3), .nx-plan-table td:nth-child(3) { width: 17%; }
.nx-plan-table th:nth-child(4), .nx-plan-table td:nth-child(4) { width: 14%; }
.nx-plan-table th:nth-child(5), .nx-plan-table td:nth-child(5) { width: 22%; }
.nx-plan-table th:nth-child(6), .nx-plan-table td:nth-child(6) { width: 12%; }
.nx-fee-table th:nth-child(1), .nx-fee-table td:nth-child(1) { width: 33%; }
.nx-fee-table th:nth-child(2), .nx-fee-table td:nth-child(2) { width: 22%; }
.nx-fee-table th:nth-child(3), .nx-fee-table td:nth-child(3) { width: 16%; }
.nx-fee-table th:nth-child(4), .nx-fee-table td:nth-child(4) { width: 14%; }
.nx-fee-table th:nth-child(5), .nx-fee-table td:nth-child(5) { width: 15%; }
.nx-access-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nx-access-head .nx-row-actions { flex-wrap: wrap; }
.nx-access-note { margin: 5px 0 0; max-width: 660px; color: var(--mut); font-size: 12px; line-height: 1.4; }
.nx-users-table td:nth-child(4) .sub { max-width: 220px; white-space: normal; overflow: hidden; text-overflow: ellipsis; }
.nx-users-table th:nth-child(1), .nx-users-table td:nth-child(1) { width: 22%; }
.nx-users-table th:nth-child(2), .nx-users-table td:nth-child(2) { width: 20%; }
.nx-users-table th:nth-child(3), .nx-users-table td:nth-child(3) { width: 14%; }
.nx-users-table th:nth-child(4), .nx-users-table td:nth-child(4) { width: 22%; }
.nx-users-table th:nth-child(5), .nx-users-table td:nth-child(5) { width: 12%; }
.nx-users-table th:nth-child(6), .nx-users-table td:nth-child(6) { width: 10%; }
.nx-plan-note { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.nx-plan-note b { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.nx-plan-note span { font-size: 12.5px; color: var(--mut); line-height: 1.4; }
.nx-modal-card--compact { width: min(560px, 100%); padding: 15px; overflow-x: hidden; }
.nx-modal-card--compact .nx-modal-title { font-size: 17px; margin-bottom: 4px; }
.nx-modal-card--compact .nx-modal-desc { font-size: 11.8px; line-height: 1.35; margin-bottom: 10px; }
.nx-modal-card--compact .nx-form { gap: 8px; }
.nx-modal-card--compact .nx-fast-form { gap: 7px; }
.nx-modal-card--compact .nx-form label { font-size: 10.8px; }
.nx-modal-card--compact .nx-field,
.nx-modal-card--compact input,
.nx-modal-card--compact select,
.nx-modal-card--compact textarea { font-size: 12px; padding: 8px 9px; }
.nx-modal-card--compact .row { gap: 7px; }
.nx-modal-card--compact .row > label { min-width: 0; }
.nx-modal-card--compact .nx-modal-details > summary { padding: 8px 10px; font-size: 11.5px; }
.nx-modal-card--compact .nx-fee-history { max-height: 170px; }
.nx-price-quick { margin-top: -2px; }
.nx-price-quick button { min-width: 0; display: grid; gap: 1px; justify-items: start; font-size: 11px; padding: 6px 9px; border-radius: 6px; }
.nx-price-quick button b { font-family: var(--mono); font-size: 12px; color: var(--fg); }
.nx-price-quick button small { color: var(--faint); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.nx-price-quick button.is-target { border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); background: var(--accsoft); }
.nx-price-quick button.is-target b,
.nx-price-quick button.is-target small { color: var(--accent); }
@media (max-width: 640px) {
  .nx-access-head { align-items: flex-start; flex-direction: column; }
  .nx-access-table th,
  .nx-access-table td { padding: 6px 4px; font-size: 10px; line-height: 1.2; }
  .nx-access-table th { font-size: 8.5px; letter-spacing: .03em; }
  .nx-access-table td .name { font-size: 10.5px; }
  .nx-access-table td .sub { display: none; }
  .nx-access-table .nx-btn--sm { padding: 5px 7px; font-size: 10px; }
  .nx-access-table .nx-icon-btn { padding: 5px; }
  .nx-access-table .nx-icon-btn svg { width: 14px; height: 14px; }
  .nx-access-table .nx-pill { font-size: 8.5px; padding: 2px 5px; }
  .nx-users-table th:nth-child(3),
  .nx-users-table td:nth-child(3),
  .nx-users-table th:nth-child(4),
  .nx-users-table td:nth-child(4),
  .nx-access-card--fees th:nth-child(4),
  .nx-access-card--fees td:nth-child(4),
  .nx-wa-table th:nth-child(3),
  .nx-wa-table td:nth-child(3),
  .nx-wa-table th:nth-child(4),
  .nx-wa-table td:nth-child(4) { display: none; }
}

/* ===== Acessos: layout administrativo organizado (redesign) ===== */
.nx-admin-panel.nx-access-stack.is-active { display: flex !important; flex-direction: column; gap: 14px; }
.nx-panel-head { padding: 2px 2px 0; }
.nx-panel-head .nx-section-title { margin-top: 2px; }
.nx-panel-sub { margin: 6px 0 0; max-width: 720px; color: var(--mut); font-size: 12px; line-height: 1.45; }
.nx-access-kpis { margin-top: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Planos + Mensalidades lado a lado (referencia de cobranca/capacidade) */
.nx-access-billing { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.nx-access-billing > .nx-access-card { min-width: 0; }
/* Tabela de planos enxuta: 5 colunas apos remover a coluna de marketing */
.nx-plan-table--lean th:nth-child(1), .nx-plan-table--lean td:nth-child(1) { width: 30%; }
.nx-plan-table--lean th:nth-child(2), .nx-plan-table--lean td:nth-child(2) { width: 18%; }
.nx-plan-table--lean th:nth-child(3), .nx-plan-table--lean td:nth-child(3) { width: 22%; }
.nx-plan-table--lean th:nth-child(4), .nx-plan-table--lean td:nth-child(4) { width: 18%; }
.nx-plan-table--lean th:nth-child(5), .nx-plan-table--lean td:nth-child(5) { width: 12%; }

/* DATAFY wallet: compact operational layout matching the customer wallet screen */
.nx-datafy-wallet { display: grid; gap: 14px; }
.nx-wallet-row { display: grid; gap: 14px; align-items: stretch; }
.nx-wallet-row--top { grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr); }
.nx-wallet-row--bottom { grid-template-columns: minmax(0, 1.1fr) minmax(0, .75fr); }
.nx-wallet-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surf); overflow: hidden; }
.nx-wallet-head { min-height: 52px; padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nx-wallet-head h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-size: 14px; font-weight: 800; }
.nx-wallet-ico { color: var(--mut); font-family: var(--mono); font-size: 13px; line-height: 1; }
.nx-wallet-body { padding: 16px 15px; }
.nx-datafy-connection-card { margin-bottom: 14px; }
.nx-connection-grid { margin-top: 13px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(180px, .7fr) minmax(220px, .9fr); gap: 12px; align-items: start; }
.nx-connection-grid label { min-width: 0; display: grid; gap: 6px; color: var(--mut); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.nx-connection-grid small { color: var(--mut); font-size: 11px; font-weight: 500; letter-spacing: 0; line-height: 1.35; text-transform: none; overflow-wrap: anywhere; }
.nx-copy-field { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.nx-copy-field .nx-field { min-width: 0; height: 34px; padding: 7px 9px; font-size: 12px; }
.nx-copy-field .nx-btn { min-height: 34px; }
.nx-wallet-value { display: block; margin: 2px 0 4px; font-family: var(--sans); font-size: 31px; font-weight: 850; letter-spacing: 0; line-height: 1; color: var(--fg); }
.nx-wallet-sub { margin: 0; color: var(--mut); font-size: 12px; line-height: 1.4; }
.nx-wallet-split { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.nx-wallet-split > div { padding: 12px 12px; min-width: 0; }
.nx-wallet-split > div + div { border-left: 1px solid var(--line); }
.nx-wallet-split span,
.nx-wallet-metrics span { display: block; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nx-wallet-split b { display: block; margin-top: 5px; color: var(--fg); font-family: var(--mono); font-size: 14px; }
.nx-wallet-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.nx-wallet-period > span:first-child { font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--fg); border: 1px solid var(--line); background: var(--chip); border-radius: 6px; padding: 6px 9px; }
.nx-wallet-period .nx-field { width: 140px; min-height: 34px; padding: 6px 10px; font-size: 12px; }
.nx-wallet-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.nx-wallet-metrics > div { min-width: 0; padding: 13px 14px; }
.nx-wallet-metrics > div + div { border-left: 1px solid var(--line); }
.nx-wallet-metrics b { display: block; margin-top: 5px; color: var(--fg); font-size: 22px; font-weight: 850; line-height: 1; }
.nx-wallet-metrics b.is-good { color: var(--accent); }
.nx-wallet-metrics b.is-bad { color: #b42318; }
.nx-wallet-metrics small { display: block; margin-top: 5px; color: var(--mut); font-size: 11px; line-height: 1.25; }
.nx-wallet-payment-form { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.nx-wallet-payment-form label { display: grid; gap: 5px; color: var(--mut); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nx-wallet-payment-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.nx-datafy-monthly-card { margin-top: 18px; }
.nx-datafy-monthly-table td { vertical-align: middle; }
.nx-datafy-adjust-card { margin-top: 18px; }
.nx-adjust-head { align-items: center; }
.nx-adjust-head > div { min-width: 0; }
.nx-adjust-head p { margin: 4px 0 0; color: var(--mut); font-size: 12px; line-height: 1.35; }
.nx-adjust-month-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nx-adjust-month-form label { display: grid; gap: 5px; color: var(--mut); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nx-adjust-month-form .nx-field { width: 146px; min-height: 34px; padding: 6px 10px; font-size: 12px; }
.nx-adjust-body { padding: 14px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.nx-adjust-status { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--chip); padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.nx-adjust-status-label { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nx-adjust-status strong { margin-top: 4px; color: var(--fg); font-size: 17px; font-weight: 850; line-height: 1; }
.nx-adjust-status small { margin-top: 7px; color: var(--mut); font-size: 11px; line-height: 1.35; }
.nx-adjust-grid { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nx-wallet-controls { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.nx-wallet-controls .nx-field { width: 100%; margin-top: 7px; }
.nx-adjust-tile { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surf); padding: 12px; display: grid; grid-template-rows: minmax(58px, 1fr) auto; gap: 10px; }
.nx-adjust-tile strong { display: block; color: var(--fg); font-size: 13px; font-weight: 850; }
.nx-adjust-tile p { margin: 5px 0 0; color: var(--mut); font-size: 11.5px; line-height: 1.35; }
.nx-adjust-tile .nx-btn { width: 100%; justify-content: center; }
.nx-adjust-tile--info { background: color-mix(in srgb, var(--chip) 70%, var(--surf)); }
.nx-adjust-tile--info .nx-pill { justify-self: start; align-self: end; }
.nx-inline-action { display: inline-flex; justify-content: flex-end; margin: 0; }
.nx-row-actions { display: inline-flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.nx-btn--icon-danger { min-width: 34px; padding-left: 9px; padding-right: 9px; color: #b42318; }
.nx-btn--danger { background: #b42318; border-color: #b42318; color: #fff; }
.nx-btn--danger:hover { background: #912018; border-color: #912018; color: #fff; }
.nx-btn--danger:disabled { opacity: .45; cursor: not-allowed; }
.nx-wallet-form { display: grid; gap: 14px; }
.nx-wallet-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nx-wallet-form-grid--topup { grid-template-columns: minmax(130px, .75fr) minmax(180px, 1fr) minmax(185px, .9fr); align-items: stretch; }
.nx-topup-preview { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--chip); padding: 11px 12px; display: grid; gap: 8px; align-content: center; }
.nx-topup-preview-label { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nx-topup-preview div { min-width: 0; display: grid; gap: 3px; }
.nx-topup-preview small { color: var(--mut); font-size: 10.5px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.nx-topup-preview strong { color: var(--fg); font-family: var(--mono); font-size: 15px; line-height: 1.1; overflow-wrap: anywhere; }
.nx-topup-preview p { margin: 0; color: var(--mut); font-size: 11px; line-height: 1.35; }
.nx-wallet-foot { margin-top: 2px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.nx-wallet-foot p { margin: 0; color: var(--mut); font-size: 12px; line-height: 1.4; }
.nx-wallet-params { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.nx-wallet-params > p { margin: 0; color: var(--mut); font-size: 12px; line-height: 1.4; }
@media (max-width: 1100px) {
  .nx-access-billing { grid-template-columns: 1fr; }
  .nx-access-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-wallet-row--top,
  .nx-wallet-row--bottom { grid-template-columns: 1fr; }
  .nx-wallet-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-wallet-metrics > div:nth-child(3) { border-left: none; border-top: 1px solid var(--line); }
  .nx-wallet-metrics > div:nth-child(4) { border-top: 1px solid var(--line); }
  .nx-connection-grid { grid-template-columns: 1fr; }
  .nx-wallet-form-grid--topup { grid-template-columns: 1fr 1fr; }
  .nx-wallet-form-grid--topup .nx-topup-preview { grid-column: 1 / -1; }
  .nx-adjust-body { grid-template-columns: 1fr; }
  .nx-wallet-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .nx-access-kpis { grid-template-columns: 1fr; }
  .nx-wallet-form-grid,
  .nx-wallet-payment-form,
  .nx-wallet-split,
  .nx-wallet-metrics { grid-template-columns: 1fr; }
  .nx-wallet-split > div + div,
  .nx-wallet-metrics > div + div { border-left: none; border-top: 1px solid var(--line); }
  .nx-wallet-payment-actions { justify-content: flex-start; }
  .nx-wallet-foot { align-items: stretch; flex-direction: column; }
  .nx-wallet-foot .nx-btn { justify-content: center; width: 100%; }
  .nx-adjust-head { align-items: flex-start; flex-direction: column; }
  .nx-adjust-month-form { width: 100%; justify-content: flex-start; }
  .nx-adjust-month-form label,
  .nx-adjust-month-form .nx-field,
  .nx-adjust-month-form .nx-btn { width: 100%; }
  .nx-adjust-grid { grid-template-columns: 1fr; }
  .nx-wallet-controls { grid-template-columns: 1fr; }
}

/* ===== Clientes: faixa de indicadores da carteira ===== */
.nx-portfolio-kpis { margin: 0 0 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .nx-portfolio-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .nx-portfolio-kpis { grid-template-columns: 1fr; } }
