:root {
  --ink: rgb(8,24,44);
  --ink-2: rgb(12,35,64);
  --slate: rgb(57,70,86);
  --mute: rgb(136,144,154);
  --line: rgb(225,227,230);
  --line-2: rgb(235,236,237);
  --bg: rgb(245,246,247);
  --white: #fff;
  --blue: rgb(0,133,202);
  --blue-tint: rgb(235,245,251);
  --green: rgb(84,161,133);
  --green-dot: rgb(105,202,167);
  --green-bg: rgba(105,202,167,0.16);
  --amber: rgb(224,168,61);
  --amber-bg: rgba(224,168,61,0.16);
  --red: rgb(224,54,78);
  --red-bg: rgba(224,54,78,0.16);
  --purple: rgb(151,71,255);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--white); font-family: "Lexend", system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
input, button, textarea, select { font-family: inherit; }

.viewport { position: fixed; inset: 0; display: grid; place-items: center; background: #eef0f2; overflow: hidden; }
.stage { width: 1728px; height: 1117px; background: var(--white); transform-origin: center center; position: relative; display: grid; grid-template-columns: 64px 245px 1fr 64px; box-shadow: 0 30px 80px rgba(8,24,44,0.18); }

/* PRIMARY RAIL */
.nav-primary { background: var(--ink); display: flex; flex-direction: column; align-items: center; }
.nav-logo { width: 64px; height: 64px; background: var(--ink-2); display: grid; place-items: center; color: #f3f5f8; position: relative; }
.nav-logo::after { content: ""; position: absolute; inset: 12px; border-radius: 10px; background: linear-gradient(180deg, #142a44 0%, #08182c 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 2px 6px rgba(0,0,0,0.4); }
.nav-logo svg { width: 38px; height: 38px; position: relative; z-index: 1; }
.nav-primary .icon-btn { width: 64px; height: 64px; display: grid; place-items: center; color: var(--mute); position: relative; cursor: pointer; border: 0; background: transparent; }
.nav-primary .icon-btn:hover { color: var(--bg); }
.nav-primary .icon-btn.active::before { content: ""; position: absolute; left: 8px; top: 8px; width: 48px; height: 48px; border-radius: 8px; background: var(--bg); }
.nav-primary .icon-btn.active svg { color: var(--ink); position: relative; z-index: 1; }
.nav-primary .icon-btn svg { width: 20px; height: 20px; stroke-width: 1.75; }
.nav-primary .spacer { flex: 1; }
.nav-primary .bell { position: relative; }
.nav-primary .bell .dot { position: absolute; top: 18px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--green-dot); border: 2px solid var(--ink); }
.nav-primary .avatar { width: 64px; height: 64px; display: grid; place-items: center; border-top: 1px solid var(--slate); }
.nav-primary .avatar > div { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #0085CA 0%, #69caa7 100%); border: 1px solid rgba(245,246,247,0.4); box-shadow: 0 5px 15px rgba(0,0,0,0.32); font-family: "Urbanist", sans-serif; font-weight: 700; color: #fff; display: grid; place-items: center; font-size: 14px; }

/* SECONDARY NAV */
.nav-secondary { background: var(--bg); display: flex; flex-direction: column; }
.workspace { height: 64px; padding: 0 20px; background: rgba(255,255,255,0.48); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); cursor: pointer; }
.workspace .name { font-weight: 700; font-size: 16px; }
.workspace svg { width: 18px; height: 18px; color: var(--slate); }
.nav-items { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { height: 39px; padding: 0 8px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-weight: 300; font-size: 16px; color: var(--ink); cursor: pointer; transition: background 120ms ease; border: 1px solid transparent; }
.nav-item:hover { background: rgba(8,24,44,0.04); }
.nav-item.active { background: var(--line-2); border-color: rgba(255,255,255,0.6); font-weight: 500; }
.nav-item svg { width: 20px; height: 20px; color: var(--blue); stroke-width: 1.75; flex-shrink: 0; }
.nav-section-label { padding: 16px 16px 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.nav-count { margin-left: auto; font-size: 12px; color: var(--mute); font-weight: 500; }

/* MAIN */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.page-header { height: 120px; padding: 32px 66px 32px 41px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.page-header .left { display: flex; align-items: center; gap: 16px; }
.badge-icon { width: 56px; height: 56px; border-radius: 99px; background: rgba(225,227,230,0.55); display: grid; place-items: center; }
.badge-icon svg { width: 22px; height: 22px; color: var(--blue); stroke-width: 1.75; }
.badge-icon.btn { cursor: pointer; transition: background 120ms ease; }
.badge-icon.btn:hover { background: rgba(225,227,230,0.9); }
.page-title-block { display: flex; flex-direction: column; gap: 2px; }
.page-eyebrow { font-weight: 300; font-size: 13px; color: var(--mute); letter-spacing: 0.02em; }
.breadcrumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); font-weight: 300; flex-wrap: wrap; }
.breadcrumb-link { background: transparent; border: 0; padding: 2px 4px; margin: 0 -4px; border-radius: 4px; color: var(--mute); font: inherit; cursor: pointer; transition: color 120ms ease, background 120ms ease; }
.breadcrumb-link:hover { color: var(--blue); background: var(--blue-tint); }
.breadcrumb-link:focus-visible { outline: none; color: var(--blue); box-shadow: 0 0 0 2px rgba(0,133,202,0.35); }
.breadcrumb-current { color: var(--slate); font-weight: 400; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-sep { color: #c8ccd2; font-size: 14px; line-height: 1; }
.page-title { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 28px; color: var(--ink); line-height: 1.2; margin: 0; }
.page-header .right { display: flex; align-items: center; gap: 16px; }
.count-pill { font-size: 15px; color: var(--mute); font-weight: 300; }
.search { width: 300px; height: 56px; border-radius: 28px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 12px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-weight: 300; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: var(--mute); }
.search svg { width: 18px; height: 18px; color: var(--slate); stroke-width: 1.75; }
.search .filter { color: var(--ink); }
.add-btn { width: 56px; height: 56px; border-radius: 99px; background: var(--ink-2); border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 20px rgba(12,35,64,0.28); transition: transform 120ms ease; }
.add-btn:hover { transform: translateY(-1px); }
.add-btn svg { width: 20px; height: 20px; }

.page-body { flex: 1; padding: 0 41px 32px; overflow-y: auto; overflow-x: hidden; }
.page-body::-webkit-scrollbar { width: 8px; }
.page-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

/* TOOLBAR */
.toolbar { height: 48px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tabs { display: flex; align-items: center; gap: 4px; background: rgba(245,246,247,0.6); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs .tab { height: 32px; padding: 0 14px; border-radius: 8px; display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; color: var(--slate); cursor: pointer; border: 0; background: transparent; }
.tabs .tab.active { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 2px 6px rgba(8,24,44,0.06); }
.tabs .tab .count { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 99px; background: var(--line-2); color: var(--slate); }
.tabs .tab.active .count { background: var(--blue-tint); color: var(--blue); }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.ghost-btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; color: var(--slate); cursor: pointer; }
.ghost-btn:hover { background: var(--bg); }
.ghost-btn svg { width: 16px; height: 16px; }

/* TABLE */
.table { background: rgba(255,255,255,0.5); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.row { display: grid; align-items: center; padding: 0 12px; column-gap: 24px; height: 58px; border-bottom: 1px solid var(--line); background: rgba(245,246,247,0.32); transition: background 100ms ease; }
.row.head { background: rgba(255,255,255,0.6); border-bottom: 1px solid var(--mute); height: 53px; }
.row:last-child { border-bottom: 0; }
.row:not(.head):hover { background: rgba(0,133,202,0.04); cursor: pointer; }
.cb { width: 18px; height: 18px; border: 1.5px solid var(--mute); border-radius: 4px; background: #fff; display: grid; place-items: center; cursor: pointer; transition: background 100ms ease, border-color 100ms ease; }
.cb:hover { border-color: var(--slate); }
.cb.checked { background: var(--blue); border-color: var(--blue); }
.cb.checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }
.cb.indet { background: var(--blue); border-color: var(--blue); }
.cb.indet::after { content: ""; width: 8px; height: 2px; background: #fff; border-radius: 1px; }
.radio { width: 18px; height: 18px; border: 1.5px solid var(--mute); border-radius: 50%; background: #fff; display: grid; place-items: center; cursor: pointer; transition: border-color 120ms, background 120ms; }
.radio.checked { border-color: var(--blue); }
.radio.checked::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.col-head { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; color: var(--ink); }
.col-head .sort { width: 16px; height: 16px; display: grid; place-items: center; color: var(--blue); }
.col-head .sort svg { width: 14px; height: 10px; }
.cell-name { font-weight: 500; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.cell-name .meta-stack { display: flex; flex-direction: column; min-width: 0; }
.cell-name .meta-stack .nm { font-weight: 500; font-size: 14px; color: var(--ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-name .meta-stack .em { font-size: 12px; color: var(--mute); font-weight: 300; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

/* View-mode toggle (grid / table) */
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.view-toggle .view-btn { all: unset; cursor: pointer; width: 32px; height: 30px; display: grid; place-items: center; color: var(--mute); border-radius: 7px; transition: background 0.15s, color 0.15s; }
.view-toggle .view-btn svg { width: 16px; height: 16px; }
.view-toggle .view-btn:hover { color: var(--ink-2); }
.view-toggle .view-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(8,24,44,0.08); }

/* Type chip — Input / Output / Both */
.type-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 1.4; letter-spacing: 0.005em; white-space: nowrap; }
.type-chip-ic { display: inline-grid; place-items: center; width: 12px; height: 12px; }
.type-chip-ic svg { width: 12px; height: 12px; }

/* Table empty / error / skeleton */
.table-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 24px; text-align: center; gap: 4px; }
.table-empty-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--bg); color: var(--mute); display: grid; place-items: center; margin-bottom: 14px; }
.table-empty-icon svg { width: 24px; height: 24px; }
.table-empty-icon.error { background: var(--red-bg); color: var(--red); }
.table-empty-title { font-family: "Urbanist", sans-serif; font-weight: 600; font-size: 17px; color: var(--ink); letter-spacing: -0.005em; }
.table-empty-body { color: var(--mute); font-size: 13.5px; max-width: 380px; line-height: 1.55; margin-top: 4px; }

.skel-row { pointer-events: none; }
.skel { display: inline-block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%); background-size: 200% 100%; animation: skel-shimmer 1.4s linear infinite; }
@keyframes skel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.swatch { width: 28px; height: 28px; border-radius: 7px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.cell { font-weight: 300; font-size: 15px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint { display: inline-flex; align-items: center; gap: 8px; }
.endpoint .glyph { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--slate); background: #fff; flex-shrink: 0; }
.endpoint .glyph svg { width: 12px; height: 12px; }

.status { height: 28px; border-radius: 24px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; width: fit-content; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; }
.status.active { background: var(--green-bg); color: var(--green); }
.status.active .dot { background: var(--green-dot); }
.status.warn { background: var(--amber-bg); color: var(--amber); }
.status.warn .dot { background: var(--amber); }
.status.error { background: var(--red-bg); color: var(--red); }
.status.error .dot { background: var(--red); }
.status.draft { background: var(--line-2); color: var(--slate); }
.status.draft .dot { background: var(--mute); }
.status.info { background: var(--blue-tint); color: var(--blue); }
.status.info .dot { background: var(--blue); }

.more { width: 28px; height: 28px; display: grid; place-items: center; color: var(--mute); border-radius: 8px; cursor: pointer; background: transparent; border: 0; padding: 0; transition: background 120ms ease, color 120ms ease; }
.more:hover { background: var(--line-2); color: var(--ink); }
.more:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(0,133,202,0.35); }
.more:active { background: var(--line); }
.more svg { width: 18px; height: 18px; }

.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px 0; font-size: 13px; color: var(--mute); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--slate); display: grid; place-items: center; cursor: pointer; font-weight: 500; font-size: 13px; }
.pager button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* RAIL RIGHT */
.rail-right { background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; }
.rail-right .icon-btn { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: var(--slate); cursor: pointer; border: 0; background: transparent; }
.rail-right .icon-btn:hover { background: rgba(8,24,44,0.06); }
.rail-right .icon-btn svg { width: 18px; height: 18px; }
.rail-right .spacer { flex: 1; }
.rail-right .health { width: 40px; height: 40px; border-radius: 8px; background: var(--green-bg); color: var(--green); display: grid; place-items: center; }
.rail-right .health svg { width: 18px; height: 18px; }

/* DASHBOARD */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.dark { background: var(--ink); color: var(--bg); border-color: transparent; }
.card.tint { background: linear-gradient(160deg, rgba(0,133,202,0.08), rgba(0,133,202,0)); }
.card .label { font-size: 13px; color: var(--mute); font-weight: 400; display: flex; align-items: center; gap: 8px; }
.card.dark .label { color: rgba(245,246,247,0.7); }
.card .label .ic { width: 28px; height: 28px; border-radius: 7px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.card .label .ic svg { width: 14px; height: 14px; }
.card.dark .label .ic { background: rgba(255,255,255,0.08); color: var(--green-dot); }
.card .metric { font-family: "Urbanist", sans-serif; font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.card .metric-sub { font-family: "Lexend", sans-serif; font-size: 18px; font-weight: 400; color: var(--mute); letter-spacing: 0; }
.card.dark .metric-sub { color: rgba(255,255,255,0.5); }
.dash-grid .card { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.dash-grid .card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(8,24,44,0.06); }
.dash-grid .card.dark:hover { border-color: rgba(255,255,255,0.2); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.card.dark .metric { color: #fff; }
.card .delta { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

.spark { height: 56px; width: 100%; }

.section-title { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); margin: 24px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.section-title .tools { display: flex; gap: 8px; }

/* BIG CHART */
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.chart-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-card .head h3 { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 18px; margin: 0; color: var(--ink); }
.chart-card .legend { display: flex; gap: 16px; font-size: 13px; color: var(--slate); }
.chart-card .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* TWO COL */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* EVENT LIST */
.evlist { display: flex; flex-direction: column; }
.evlist .ev { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.evlist .ev:last-child { border-bottom: 0; }
.evlist .ev .icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.evlist .ev .icon.g { background: var(--green-bg); color: var(--green); }
.evlist .ev .icon.a { background: var(--amber-bg); color: var(--amber); }
.evlist .ev .icon.r { background: var(--red-bg); color: var(--red); }
.evlist .ev .icon.b { background: var(--blue-tint); color: var(--blue); }
.evlist .ev .icon svg { width: 16px; height: 16px; }
.evlist .ev .body { display: flex; flex-direction: column; }
.evlist .ev .ttl { font-size: 14px; color: var(--ink); font-weight: 500; }
.evlist .ev .sub { font-size: 12px; color: var(--mute); }
.evlist .ev .when { font-size: 12px; color: var(--mute); }

/* FORM */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 880px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field .lbl { font-weight: 700; font-size: 15px; color: var(--slate); }
.field .hint { font-size: 12px; color: var(--mute); font-weight: 300; }
.input, .select, .textarea { width: 100%; height: 56px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; color: var(--ink); font-weight: 300; outline: 0; transition: border-color 120ms ease; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,133,202,0.1); }
.textarea { height: 140px; padding: 16px 18px; resize: vertical; }
.select { appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23394656' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 20px center, #fff; padding-right: 50px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; max-width: 880px; justify-content: flex-end; }
.btn-primary { height: 48px; padding: 0 24px; border-radius: 999px; border: 0; background: var(--ink-2); color: #fff; font-weight: 500; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { background: var(--ink); }
.btn-secondary { height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 500; font-size: 15px; cursor: pointer; }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.set-nav { display: flex; flex-direction: column; gap: 4px; }
.set-nav .item { padding: 10px 14px; border-radius: 8px; font-size: 14px; color: var(--slate); cursor: pointer; }
.set-nav .item.active { background: var(--blue-tint); color: var(--blue); font-weight: 500; }
.set-nav .item:hover:not(.active) { background: var(--bg); }
.settings-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.settings-panel h2 { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 22px; margin: 0 0 6px; }
.settings-panel .sub { color: var(--mute); font-size: 14px; margin-bottom: 24px; }
.set-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); align-items: center; }
.set-row:first-child { border-top: 0; padding-top: 0; }
.set-row .ttl { font-weight: 500; font-size: 15px; color: var(--ink); }
.set-row .desc { font-size: 13px; color: var(--mute); margin-top: 2px; }
.toggle { width: 44px; height: 24px; background: var(--line); border-radius: 99px; position: relative; cursor: pointer; transition: background 120ms ease; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 120ms ease; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.toggle.on { background: var(--blue); }
.toggle.on::after { left: 22px; }

/* SOURCES — connector cards */
.connector-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.connector { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform 120ms, box-shadow 120ms; }
.connector:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(8,24,44,0.08); }
.connector .top { display: flex; align-items: center; justify-content: space-between; }
.connector .logo { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-family: "Urbanist", sans-serif; font-weight: 800; font-size: 14px; }
.connector .name { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.connector .desc { font-size: 13px; color: var(--slate); font-weight: 300; min-height: 36px; }
.connector .meta { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--mute); }
.connector .top-actions { display: flex; align-items: center; gap: 8px; }
.connector .meta-stat { display: inline-flex; align-items: center; gap: 6px; }
.connector .meta-stat .meta-kind { color: var(--ink); font-weight: 500; }
.connector .meta-stat .meta-dot { color: var(--line); }

/* EDIT / CONFIGURE BUTTON — small, inline */
.edit-btn {
  height: 30px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Lexend", sans-serif; font-weight: 500; font-size: 13px;
  color: var(--ink); cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.edit-btn svg { width: 14px; height: 14px; stroke-width: 1.75; color: var(--slate); }
.edit-btn:hover { background: var(--blue-tint); border-color: var(--blue); color: var(--blue); }
.edit-btn:hover svg { color: var(--blue); }
.edit-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,133,202,0.18); border-color: var(--blue); }
.edit-btn:active { transform: translateY(1px); }

/* USERS / CUSTOMERS bits */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .meta-stack { display: flex; flex-direction: column; }
.user-cell .meta-stack .nm { font-weight: 500; font-size: 14px; color: var(--ink); }
.user-cell .meta-stack .em { font-size: 12px; color: var(--mute); font-weight: 300; }

.role-pill { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--slate); width: fit-content; }
.role-pill.admin { background: rgba(151,71,255,0.12); color: var(--purple); }
.role-pill.owner { background: var(--blue-tint); color: var(--blue); }
.role-pill.viewer { background: var(--line-2); color: var(--slate); }

/* TOOL TIP */
.fig-tip { position: absolute; left: 200px; bottom: 60px; width: 320px; background: var(--ink-2); color: var(--bg); padding: 16px 20px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.18); font-size: 14px; font-weight: 300; line-height: 1.6; }
.fig-tip::before { content: ""; position: absolute; left: 30px; top: -7px; width: 14px; height: 14px; background: var(--ink-2); transform: rotate(45deg); }

/* AUDIT details */
.audit-action { display: inline-flex; align-items: center; gap: 6px; }
.audit-action .verb { background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; font-family: "Sometype Mono", "JetBrains Mono", monospace; font-size: 12px; color: var(--ink); }

/* =====================================================
   MAPPING CONFIGURATION PAGE
   ===================================================== */

/* Identity strip */
.mapping-id { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; margin-bottom: 20px; }
.mapping-id-left { display: flex; align-items: center; gap: 16px; }
.mapping-id-logos { display: flex; align-items: center; gap: 10px; }
.mapping-id-left .logo { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-family: "Urbanist", sans-serif; font-weight: 800; font-size: 16px; }
.mapping-id-meta { display: flex; flex-direction: column; }
.mapping-id-meta .ec { font-size: 12px; color: var(--mute); font-weight: 300; letter-spacing: 0.02em; text-transform: uppercase; }
.mapping-id-meta .nm { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.mapping-id-meta .sub { font-size: 13px; color: var(--slate); font-weight: 300; margin-top: 6px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mapping-id-meta .sub .dot-sep { color: var(--mute); }

/* Step rail */
.step-rail { display: flex; align-items: center; gap: 4px; margin-bottom: 24px; padding: 6px; background: rgba(245,246,247,0.6); border: 1px solid var(--line); border-radius: 14px; width: fit-content; }
.step-pill { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-family: "Lexend", sans-serif; font-size: 14px; font-weight: 400; color: var(--slate); transition: background 120ms, color 120ms, box-shadow 120ms; }
.step-pill:hover { color: var(--ink); }
.step-pill.active { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 2px 6px rgba(8,24,44,0.08); }
.step-pill[disabled] { opacity: 0.5; cursor: not-allowed; }
.step-pill.done .step-num { background: var(--green-bg); color: var(--green); }
.step-pill.done .step-num svg { width: 14px; height: 14px; stroke-width: 2; }
.step-pill .step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 12px; background: var(--line-2); color: var(--slate); flex-shrink: 0; }
.step-pill.active .step-num { background: var(--ink-2); color: #fff; }
.step-line { width: 24px; height: 1px; background: var(--line); flex-shrink: 0; }

/* Section cards (reusable) */
.section-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px 28px; margin-bottom: 16px; }
.section-card-head { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-card-title { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); }
.section-card-sub { font-size: 13px; color: var(--mute); font-weight: 300; margin-top: 2px; }

/* Endpoint pair (input → output) */
.endpoint-pair { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 12px; align-items: stretch; }
.endpoint-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fff; transition: border-color 120ms, box-shadow 120ms; }
.endpoint-card.locked { background: var(--bg); border-style: dashed; }
.endpoint-card.empty { display: grid; place-items: center; min-height: 120px; color: var(--mute); border-style: dashed; }
.endpoint-role { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--mute); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
.endpoint-locked { display: inline-flex; align-items: center; gap: 4px; color: var(--slate); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.endpoint-locked svg { width: 12px; height: 12px; stroke-width: 2; }
.endpoint-body { display: flex; align-items: center; gap: 14px; }
.endpoint-body .logo { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-family: "Urbanist", sans-serif; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.endpoint-meta { flex: 1; min-width: 0; }
.endpoint-name { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); }
.endpoint-kind { font-size: 12px; color: var(--mute); font-weight: 300; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-select { position: relative; display: flex; align-items: center; }
.endpoint-select .select.bare { height: 36px; padding: 0 32px 0 12px; border-radius: 8px; font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); background-image: none; border: 1px solid var(--line); }
.endpoint-select svg { position: absolute; right: 10px; pointer-events: none; width: 14px; height: 14px; color: var(--slate); }
.endpoint-arrow { display: grid; place-items: center; color: var(--blue); }

/* Authentication panels */
.auth-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.auth-panel { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--bg); }
.auth-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.auth-side-pill { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.06em; padding: 4px 8px; border-radius: 6px; }
.auth-panel-label { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); flex: 1; }
.auth-test-ok { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: var(--green-bg); color: var(--green); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.auth-test-ok svg { width: 16px; height: 16px; stroke-width: 2; }

/* Field-mapping table (reference image) */
.mapping-card { padding: 24px 28px 22px; }
.mapping-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mapping-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; white-space: nowrap; min-width: 0; overflow: hidden; }
.mapping-eyebrow { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 14px; color: var(--slate); flex-shrink: 0; }
.mapping-route { display: inline-flex; align-items: center; gap: 8px; font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); }
.mapping-route svg { width: 16px; height: 16px; color: var(--slate); stroke-width: 1.75; }

.mapping-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.mapping-row { display: grid; grid-template-columns: 1fr 40px 1fr 130px 44px; align-items: center; padding: 10px 18px; gap: 12px; border-top: 1px solid var(--line); transition: background 120ms; }
.mapping-row:first-child { border-top: 0; }
.mapping-row:not(.head):nth-child(even) { background: rgba(245,246,247,0.5); }
.mapping-row:not(.head):hover { background: var(--blue-tint); }
.mapping-row:not(.head):hover .mapping-arrow { color: var(--blue); }
.mapping-row.head { background: #fff; padding: 14px 18px; font-size: 13px; font-weight: 500; color: var(--ink); }
.mapping-row.head > div:first-child,
.mapping-row.head > div:nth-child(3) { font-weight: 700; font-family: "Urbanist", sans-serif; font-size: 14px; }
.mapping-row.highlight .mapping-arrow { color: var(--blue); }
.mapping-cell { display: flex; align-items: center; }
.mapping-arrow { display: grid; place-items: center; color: var(--mute); }
.mapping-remove { justify-content: flex-end; opacity: 0; transition: opacity 120ms; }
.mapping-row:hover .mapping-remove { opacity: 1; }
.mapping-input { border: 0; background: transparent; font-family: "Sometype Mono", "JetBrains Mono", monospace; font-size: 13px; color: var(--ink); padding: 6px 8px; border-radius: 6px; width: 100%; outline: none; transition: background 120ms, box-shadow 120ms; }
.mapping-input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(0,133,202,0.2); }
.mapping-row:hover .mapping-input { background: #fff; }

/* Required / Optional pill */
.req-pill { border: 0; height: 26px; padding: 0 12px; border-radius: 999px; font-family: "Lexend", sans-serif; font-weight: 500; font-size: 12px; cursor: pointer; transition: background 120ms, color 120ms, box-shadow 120ms; }
.req-pill.required { background: rgba(151,71,255,0.12); color: var(--purple); }
.req-pill.required:hover { background: rgba(151,71,255,0.22); }
.req-pill.optional { background: var(--line-2); color: var(--slate); }
.req-pill.optional:hover { background: var(--line); color: var(--ink); }
.req-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,133,202,0.18); }

/* Small icon-only ghost button */
.ghost-icon { width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--mute); cursor: pointer; display: grid; place-items: center; transition: background 120ms, color 120ms; }
.ghost-icon:hover { background: var(--red-bg); color: var(--red); }
.ghost-icon svg { width: 14px; height: 14px; stroke-width: 1.75; }

.mapping-footnote { margin-top: 14px; font-size: 12px; color: var(--mute); font-weight: 300; }

/* Footer actions for mapping page */
.mapping-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.mapping-actions-right { display: flex; align-items: center; gap: 10px; }

/* Empty state */
.empty-mapping { display: grid; place-items: center; min-height: 400px; }
.empty-mapping-card { text-align: center; max-width: 380px; }
.empty-mapping-card h3 { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.empty-mapping-card p { font-size: 14px; color: var(--slate); font-weight: 300; margin: 0 0 20px; line-height: 1.5; }

/* =====================================================
   MAPPINGS LIST PAGE
   ===================================================== */
.map-sub { font-size: 12px; color: var(--mute); font-weight: 300; }
.map-route { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.map-route .endpoint { font-size: 13px; color: var(--ink); font-weight: 400; }
.map-route-arrow { color: var(--blue); font-weight: 500; }

.field-chip { display: inline-flex; align-items: baseline; gap: 2px; padding: 4px 10px; border-radius: 6px; background: var(--blue-tint); color: var(--blue); font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 13px; }
.field-chip .of { font-weight: 400; color: var(--slate); opacity: 0.7; }

.sched-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-family: "Sometype Mono", "JetBrains Mono", monospace; font-size: 12px; color: var(--ink); }

.select.compact { height: 36px; padding: 0 32px 0 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; font-weight: 400; color: var(--ink); width: auto; min-width: 160px; background-position: right 10px center; background-size: 10px; }

/* =====================================================
   CONNECTION PICKER PAGE
   ===================================================== */
.pick-preview { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 12px; align-items: stretch; margin-bottom: 20px; }
.pick-slot { background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 18px 22px; min-height: 96px; display: flex; flex-direction: column; gap: 10px; transition: border-color 120ms, background 120ms, box-shadow 120ms; }
.pick-slot.filled { border-style: solid; border-color: var(--line); }
.pick-slot-label { font-size: 12px; color: var(--mute); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.pick-slot-body { display: flex; align-items: center; gap: 14px; }
.pick-slot-body .logo { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-family: "Urbanist", sans-serif; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.pick-slot-name { font-family: "Urbanist", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); line-height: 1.2; }
.pick-slot-kind { font-size: 13px; color: var(--slate); font-weight: 300; margin-top: 2px; }
.pick-slot-placeholder { color: var(--mute); font-size: 14px; font-weight: 300; font-style: italic; display: flex; align-items: center; flex: 1; min-height: 48px; }
.pick-arrow { display: grid; place-items: center; color: var(--blue); }
.pick-arrow svg { width: 28px; height: 28px; stroke-width: 1.5; }

.connector.picker { position: relative; }
.connector.picker.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,133,202,0.15); }
.connector.picker.selected .name { color: var(--blue); }
.connector.picker.disabled { opacity: 0.4; cursor: not-allowed; }
.connector.picker.disabled:hover { transform: none; box-shadow: none; }
.connector-check { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; }
.connector-check svg { width: 16px; height: 16px; stroke-width: 2; }
