/* ============================================================
   Sanchar design system — navy and violet, Inter, like sancharsolutions.com
   Sea-glass paper, deep teal ink, marigold signal. Flat surfaces, hairlines, one memorable element: the switchboard jacks.
   ============================================================ */
:root {
  --paper: #f5f5fb;
  --surface: #ffffff;
  --surface-2: #fafaff;
  --ink: #10112c;
  --muted: #5d5e7e;
  --line: #e2e1f3;
  --line-2: #cfcde8;
  --teal: #6c4ce0;
  --teal-d: #5a3cc8;
  --teal-soft: #e4e3fa;
  --signal: #f2a516;
  --signal-soft: #fdf0cf;
  --ok: #1f9d55;
  --ok-soft: #dcf3e5;
  --warn: #a8660b;
  --warn-soft: #fdecc8;
  --bad: #c2412d;
  --bad-soft: #fbe0da;
  --rail: #0a0b22;
  --rail-2: #181a4a;
  --rail-ink: #c7c5f0;
  --r: 10px;
  --r-lg: 14px;
  --font-ui: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Inter Variable', 'Inter', var(--font-ui);
  --bs-body-font-family: var(--font-ui);
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-primary: var(--teal);
  --bs-primary-rgb: 108, 76, 224;
  --bs-link-color: var(--teal-d);
  --bs-link-hover-color: var(--teal);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-radius: var(--r);
  --bs-border-radius-lg: var(--r-lg);
  --bs-success: var(--ok);
  --bs-danger: var(--bad);
  --bs-warning: var(--signal);
}
[data-bs-theme='dark'] {
  --paper: #0a1a1c;
  --surface: #102427;
  --surface-2: #0d2023;
  --ink: #e4f0ee;
  --muted: #8fa9a6;
  --line: #1d393c;
  --line-2: #29494c;
  --teal: #2cc0b2;
  --teal-d: #52d3c6;
  --teal-soft: #123c3b;
  --signal-soft: #3a2c0a;
  --ok-soft: #12351f;
  --warn-soft: #3a2c0a;
  --bad-soft: #3a1914;
  --rail: #061416;
  --rail-2: #0e2a2d;
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-primary-rgb: 44, 192, 178;
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line);
}

html, body { height: 100%; }
body { font-family: var(--font-ui); font-size: .94rem; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1; }
h1, h2, h3, h4, h5, .display-font { font-family: var(--font-display); letter-spacing: -.015em; font-weight: 650; }
h4 { font-size: 1.45rem; } h5 { font-size: 1.12rem; } h6 { font-size: .98rem; font-weight: 650; font-family: var(--font-ui); }
.text-muted { color: var(--muted) !important; }
a { text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- shell ---------- */
.shell { display: flex; height: 100dvh; overflow: hidden; }
.rail { width: 248px; flex: none; background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; overflow-y: auto; padding: .9rem .7rem 1rem; scrollbar-width: thin; scrollbar-color: var(--rail-2) transparent; }
.rail .brand { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem .9rem; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.02em; }
.rail .brand img { width: 30px; height: 30px; }
.rail .grp { font-size: .74rem; letter-spacing: .02em; color: #6f9390; padding: .95rem .6rem .3rem; font-weight: 600; }
.rail .nav-i { display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; border-radius: 8px; color: var(--rail-ink); text-decoration: none; position: relative; margin: 1px 0; font-weight: 500; }
.rail .nav-i i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.rail .nav-i:hover { background: var(--rail-2); color: #fff; }
.rail .nav-i.active { background: var(--rail-2); color: #fff; }
.rail .nav-i.active::before { content: ''; position: absolute; left: -.7rem; top: .45rem; bottom: .45rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--signal); }
.rail .rail-foot { margin-top: auto; padding: .9rem .6rem 0; border-top: 1px solid var(--rail-2); font-size: .85rem; }
.rail .rail-foot a { color: #8fb0ac; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; }
.topbar { flex: none; display: flex; align-items: center; gap: .6rem; padding: .55rem 1.1rem; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 56px; }
.topbar .title { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; letter-spacing: -.01em; margin: 0 auto 0 .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .7rem; border-radius: 999px; background: var(--signal-soft); color: #6d4a00; font-weight: 600; font-size: .86rem; text-decoration: none; border: 1px solid transparent; }
[data-bs-theme='dark'] .chip { color: #f5c75a; }
.chip:hover { border-color: var(--signal); color: inherit; }
.chip.low { background: var(--bad-soft); color: var(--bad); }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.icon-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
#main { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.page { padding: 1.3rem 1.4rem !important; }
.tabbar { display: none; }

@media (max-width: 991.98px) {
  .shell { flex-direction: column; }
  .rail { position: fixed; z-index: 1045; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 0 100vmax rgba(0,0,0,0); }
  .rail.open { transform: none; box-shadow: 0 0 0 100vmax rgba(6, 20, 22, .55); }
  .stage { height: auto; flex: 1; min-height: 0; }
  .topbar { padding: .45rem .8rem; }
  .page { padding: 1rem .9rem 1.4rem !important; }
  .tabbar { display: flex; flex: none; background: var(--surface); border-top: 1px solid var(--line); padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem 0; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; position: relative; border-radius: 10px; }
  .tabbar a i { font-size: 1.25rem; }
  .tabbar a.active { color: var(--teal-d); }
  .tabbar a.active::after { content: ''; position: absolute; top: -.26rem; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--signal); }
  .tabbar .badge { position: absolute; top: 1px; left: 56%; font-size: .6rem; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; }
.card-footer, .card-header { background: transparent; border-color: var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.1rem; }
.panel + .panel { margin-top: 1rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1rem; margin-bottom: 1.1rem; }
.page-head h4 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: .38rem .85rem; border-radius: 7px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--teal); color: #fff; }
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--line-2); display: block; margin-bottom: .4rem; }
.empty strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; margin-bottom: .2rem; }

/* bootstrap overrides */
.btn { border-radius: 9px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-d); --bs-btn-hover-border-color: var(--teal-d); --bs-btn-active-bg: var(--teal-d); --bs-btn-active-border-color: var(--teal-d); --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
[data-bs-theme='dark'] .btn-primary { --bs-btn-color: #04201e; --bs-btn-hover-color: #04201e; --bs-btn-active-color: #04201e; }
.btn-outline-primary { --bs-btn-color: var(--teal-d); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal); --bs-btn-hover-border-color: var(--teal); --bs-btn-active-bg: var(--teal); }
.btn-outline-secondary { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-2); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line-2); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-color: var(--ink); }
.btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--line); --bs-btn-hover-color: var(--ink); }
.btn-dark { --bs-btn-bg: var(--rail); --bs-btn-border-color: var(--rail); --bs-btn-hover-bg: var(--rail-2); }
.form-control, .form-select { border-color: var(--line-2); background-color: var(--surface); border-radius: 9px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(108, 76, 224, .16); }
.form-label { font-weight: 600; font-size: .85rem; }
.form-text { color: var(--muted); }
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); margin-bottom: 0; }
.table > thead th { font-weight: 600; color: var(--muted); font-size: .8rem; border-bottom-color: var(--line-2); white-space: nowrap; }
.table > :not(caption) > * > * { padding: .7rem .75rem; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--surface-2); }
.modal-content { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.modal-header, .modal-footer { border-color: var(--line); }
.nav-tabs { border-color: var(--line); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 600; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--teal-d); background: transparent; border-bottom-color: var(--signal); }
.dropdown-menu { border-color: var(--line); border-radius: 10px; background: var(--surface); }
.badge { font-weight: 600; letter-spacing: 0; }
.alert { border-radius: var(--r); }
.progress { height: 8px; background: var(--line); border-radius: 99px; }
.progress-bar { background: var(--teal); }
#toast .alert, #toast .toast { border-radius: 10px; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--teal-soft); color: var(--teal-d); border-color: transparent; }
.pill.plain::before { display: none; }

/* ---------- switchboard (dashboard) ---------- */
.hello { margin-bottom: 1.2rem; }
.hello h4 { font-size: 1.7rem; margin: 0; }
.hello p { margin: .25rem 0 0; color: var(--muted); }
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1.3rem; }
.ledger > a, .ledger > div { padding: .95rem 1.1rem; border-right: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.ledger > :last-child { border-right: 0; }
.ledger .n { font-family: var(--font-display); font-size: 1.9rem; font-weight: 650; line-height: 1.05; letter-spacing: -.02em; }
.ledger .l { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.ledger > a:hover { background: var(--surface-2); }
@media (max-width: 575.98px) { .ledger { grid-template-columns: repeat(2, 1fr); } .ledger > * { border-bottom: 1px solid var(--line); } .ledger > :nth-child(2n) { border-right: 0; } .ledger > :nth-last-child(-n+2) { border-bottom: 0; } }
.board { background: var(--rail); border-radius: var(--r-lg); padding: 1.1rem 1.1rem 1.25rem; color: #cfe3e0; margin-bottom: 1.3rem; position: relative; overflow: hidden; }
.board::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255,255,255,.035); pointer-events: none; }
.board .bh { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-bottom: .9rem; }
.board .bh h5 { color: #fff; margin: 0; }
.board .bh small { color: #7fa6a2; }
.jacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: .7rem; position: relative; z-index: 1; }
.jack { background: var(--rail-2); border: 1px solid #1c4a4d; border-radius: 12px; padding: .75rem .7rem .7rem; cursor: pointer; text-align: left; color: #e6f2f0; position: relative; transition: border-color .15s, background .15s; }
.jack:hover { border-color: #2f7a7a; background: #164649; }
.jack .led { position: absolute; top: .65rem; right: .65rem; width: 10px; height: 10px; border-radius: 50%; background: #3d5b5a; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.jack.connected .led { background: #45e08a; box-shadow: 0 0 0 3px rgba(69,224,138,.18), 0 0 10px rgba(69,224,138,.7); }
.jack.attention .led { background: var(--signal); box-shadow: 0 0 0 3px rgba(242,165,22,.2), 0 0 10px rgba(242,165,22,.6); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.jack i { font-size: 1.55rem; display: block; margin-bottom: .55rem; }
.jack .nm { font-weight: 650; font-size: .88rem; line-height: 1.15; }
.jack .st { font-size: .74rem; color: #86aaa6; margin-top: .15rem; }
.jack.soon { opacity: .55; }

/* ---------- channel cards ---------- */
.int-tile, .ch-card { border: 1px solid var(--line) !important; border-left-width: 1px !important; box-shadow: none !important; transform: none !important; background: var(--surface); }
.ch-card:hover, .int-tile:hover { border-color: var(--line-2) !important; }
.ch-card.connected { box-shadow: inset 4px 0 0 var(--ok) !important; }
.ch-card.attention { box-shadow: inset 4px 0 0 var(--signal) !important; }
.ch-ico { width: 44px; height: 44px; border-radius: 11px; background: var(--surface-2); color: var(--teal-d); }
.dot { margin-right: .4rem; } .dot.connected { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.attention { background: var(--signal); }
.pick-tile:hover { border-color: var(--teal); background: var(--teal-soft); }

/* ---------- inbox ---------- */
.conv { padding: .75rem .9rem; border-bottom: 1px solid var(--line); }
.conv:hover, .conv.active { background: var(--teal-soft); }
.bub { border-radius: 14px; }
.bub.in { background: var(--surface); border: 1px solid var(--line); }
.bub.out { background: var(--teal); color: #fff; }
[data-bs-theme='dark'] .bub.out { color: #04201e; }
.bub.failed { background: var(--bad); color: #fff; }
.bub.delivered small::after { content: ' ✓✓'; }
.bub.event { background: transparent; border: 0; color: var(--muted); text-align: center; margin: 0 auto 6px; max-width: 90%; font-size: .85rem; padding: 2px 8px; }
.bub .subj { font-weight: 650; border-bottom: 1px solid rgba(127,127,127,.25); padding-bottom: 3px; margin-bottom: 4px; }
.bg-white { background: var(--surface) !important; }
.bg-body-tertiary { background: var(--surface-2) !important; }
#p-inbox .bg-white { background: var(--surface) !important; }

/* ---------- data tables that turn into cards on phones ---------- */
@media (max-width: 767.98px) {
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; margin-bottom: .6rem; }
  .tbl-cards td { border: 0 !important; padding: .22rem 0 !important; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .tbl-cards td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; flex: none; }
  .tbl-cards td.nolabel::before { display: none; }
  .tbl-cards td.nolabel { justify-content: flex-start; text-align: left; }
}

/* ---------- widgets used by the new pages ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; background: var(--surface); height: 100%; display: flex; flex-direction: column; }
.plan.cur { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.plan .price { font-family: var(--font-display); font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; }
.plan ul { list-style: none; padding: 0; margin: .8rem 0 1rem; font-size: .9rem; } .plan li { padding: .2rem 0; } .plan li::before { content: '✓'; color: var(--ok); margin-right: .5rem; font-weight: 700; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .83rem; background: var(--rail); color: #d6eae7; border-radius: 10px; padding: .8rem 1rem; overflow-x: auto; white-space: pre; position: relative; }
.code .cp { position: absolute; top: .4rem; right: .4rem; }
.secret-box { background: var(--signal-soft); border: 1px dashed var(--signal); border-radius: 10px; padding: .8rem 1rem; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: .86rem; }
.counter { font-size: .8rem; color: var(--muted); } .counter.over { color: var(--bad); font-weight: 650; }
.step-dots { display: flex; gap: .4rem; } .step-dots span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); } .step-dots span.on { background: var(--teal); }
.var-chip { cursor: pointer; display: inline-block; padding: .1rem .55rem; border-radius: 99px; background: var(--teal-soft); color: var(--teal-d); font-size: .78rem; font-weight: 600; margin: 0 .25rem .25rem 0; border: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-d); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.dir-in { color: var(--ok); } .dir-out { color: var(--teal); } .dir-miss { color: var(--bad); }

/* ---------- misc legacy ---------- */
.md-card { border-color: var(--line); background: var(--surface); border-radius: var(--r); }
.md-thumb { background: var(--surface-2); }
#mdDrop.drag { border-color: var(--teal) !important; background: var(--teal-soft); }
.cf .cf-guide { background: var(--surface-2); border-radius: var(--r); }
.cf .cf-gt { text-transform: none; letter-spacing: 0; font-size: .86rem; font-weight: 650; color: var(--ink); }

/* docs & auth pages share these */
.doc-wrap { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.doc-wrap h2 { font-size: 1.5rem; margin-top: 2.4rem; } .doc-wrap h3 { font-size: 1.1rem; margin-top: 1.6rem; }
.ep { display: flex; gap: .6rem; align-items: center; margin: 1rem 0 .4rem; } .ep .m { font-weight: 700; font-size: .78rem; padding: .15rem .5rem; border-radius: 6px; background: var(--teal); color: #fff; } .ep .m.get { background: #2563a8; } .ep .m.del { background: var(--bad); } .ep code { font-size: .92rem; }

.prog{min-width:0}
@media (max-width:767.98px){.tbl-cards td .prog{flex:1;text-align:right}}
@media (min-width:1200px){.ledger{grid-template-columns:repeat(6,1fr)}}

/* language switcher + right-to-left */
.lang-sel { width: auto; min-width: 7.2rem; background-color: transparent; }
.auth-lang { position: absolute; top: 1rem; right: 1rem; z-index: 5; }
.topbar-lang { margin-inline-start: auto; }
[dir=rtl] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir=rtl] .me-auto { margin-right: 0 !important; margin-left: auto !important; }
[dir=rtl] .ms-1, [dir=rtl] .ms-2, [dir=rtl] .ms-3 { margin-left: 0 !important; margin-right: .5rem !important; }
[dir=rtl] .me-1, [dir=rtl] .me-2, [dir=rtl] .me-3 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir=rtl] .text-end { text-align: left !important; }
[dir=rtl] .text-start { text-align: right !important; }
[dir=rtl] .auth-lang { right: auto; left: 1rem; }
[dir=rtl] .bi-arrow-right::before, [dir=rtl] .bi-chevron-right::before { display: inline-block; transform: scaleX(-1); }

/* ---- polish: readable page title on phones, super-admin tabs wrap on wide screens ---- */
@media (max-width: 575.98px) {
  .topbar .title { flex: 1 1 auto; min-width: 0; margin-right: 0; font-size: 1.05rem; }
  .topbar-lang { margin-inline-start: 0; }
  .lang-sel { min-width: 0; max-width: 5.4rem; padding-inline: .5rem 1.4rem; }
}
@media (min-width: 992px) {
  #saTabs { flex-wrap: wrap; overflow: visible; row-gap: .25rem; max-width: 100%; }
}

/* ---- notification bell ---- */
.bell-wrap { position: relative; }
.bell-badge { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad, #e5484d); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid var(--surface); }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(16, 17, 44, .18); z-index: 1080; overflow: hidden; }
.bell-head { display: flex; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.bell-list { max-height: min(60vh, 420px); overflow-y: auto; }
.bell-item { display: flex; gap: .65rem; align-items: flex-start; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: .7rem .9rem; color: inherit; }
.bell-item:hover { background: rgba(108, 76, 224, .06); }
.bell-item > i { font-size: 1.1rem; color: var(--teal, #6c4ce0); margin-top: .1rem; }
.bell-item.unread { background: rgba(108, 76, 224, .08); }
.bell-item.unread .bell-txt b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal, #6c4ce0); margin-left: .4rem; }
.bell-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .88rem; }
.bell-txt span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-item small { color: var(--muted); white-space: nowrap; }
@media (max-width: 575.98px) { .bell-panel { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; } }

/* ---- working inside another account ---- */
.imp-bar { position: sticky; top: 0; z-index: 1100; background: #f2a516; color: #10112c; padding: .45rem .9rem; font-size: .88rem; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* folders in the side menu: one open at a time */
.rail .nfold-h { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .5rem .65rem; border: 0; border-radius: 8px; background: transparent; color: var(--rail-ink); text-align: left; position: relative; }
.rail .nfold-h:hover { background: var(--rail-2); color: #fff; }
.rail .nfold-h > i:first-child { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.rail .nfold-h .nchev { margin-left: auto; font-size: .75rem; opacity: .6; transition: transform .18s ease; }
.rail .nfold.open > .nfold-h { color: #fff; }
.rail .nfold.open .nchev { transform: rotate(180deg); }
.rail .ndot { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; margin-left: .2rem; }
.rail .nfold-b { display: none; margin: .1rem 0 .35rem 1.05rem; padding-left: .5rem; border-left: 1px solid var(--rail-2); }
.rail .nfold.open > .nfold-b { display: block; }
.rail .nfold-b .nav-i { padding: .4rem .6rem; font-size: .92rem; }
.rail .nlist { display: flex; flex-direction: column; gap: 1px; margin-top: .3rem; }
@media (prefers-reduced-motion: reduce) { .rail .nfold-h .nchev { transition: none; } }

/* drag-and-drop flow canvas */
.fc { display: flex; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 520px; height: 68vh; overflow: hidden; }
.fc-pal { width: 190px; flex: none; border-right: 1px solid var(--line); padding: .7rem; overflow-y: auto; background: var(--surface-2); }
.fc-pal-h { font-weight: 600; margin-bottom: .5rem; }
.fc-hint { font-weight: 400; font-size: .74rem; color: var(--ink-3, #6b7280); }
.fc-pal-i { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; margin-bottom: .35rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: grab; font-size: .88rem; user-select: none; }
.fc-pal-i:hover { border-color: var(--line-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.fc-board { flex: 1; overflow: auto; position: relative; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.fc-stage { position: relative; min-width: 100%; min-height: 100%; }
.fc-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.fc-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.fc-line { fill: none; stroke: #64748b; stroke-width: 2.2; }
.fc-tmp { stroke-dasharray: 5 4; stroke: #2563eb; }
.fc-node { position: absolute; width: 250px; background: var(--surface); border: 1px solid var(--line-2, #cbd5e1); border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.fc-head { display: flex; align-items: center; gap: .45rem; padding: .4rem .6rem; color: #fff; font-weight: 600; font-size: .86rem; border-radius: 9px 9px 0 0; cursor: move; touch-action: none; }
.fc-x { margin-left: auto; border: 0; background: transparent; color: #fff; font-size: 1.1rem; line-height: 1; opacity: .8; }
.fc-x:hover { opacity: 1; }
.fc-in { position: absolute; left: -8px; top: 12px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid #64748b; }
.fc-linking .fc-in { border-color: #2563eb; transform: scale(1.25); }
.fc-body { padding: .5rem .6rem; }
.fc-f { display: block; margin-bottom: .4rem; font-size: .76rem; color: var(--ink-3, #6b7280); }
.fc-f input, .fc-f textarea, .fc-f select { width: 100%; margin-top: .1rem; font-size: .85rem; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
.fc-out { padding: 0 .1rem .4rem; }
.fc-port { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; font-size: .78rem; padding: .12rem 0; }
.fc-dot { width: 14px; height: 14px; border-radius: 50%; background: #2563eb; margin-right: -8px; cursor: crosshair; border: 3px solid var(--surface); box-shadow: 0 0 0 1px #2563eb; touch-action: none; }
@media (max-width: 767.98px) { .fc { flex-direction: column; height: auto; } .fc-pal { width: 100%; display: flex; flex-wrap: wrap; gap: .3rem; border-right: 0; border-bottom: 1px solid var(--line); } .fc-pal-h { width: 100%; } .fc-board { min-height: 460px; } }

.wa-call-card { position: fixed; right: 16px; bottom: 16px; z-index: 1080; width: min(360px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2, #cbd5e1); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .22); display: none; }
.wa-call-row { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; }
.wa-call-row + .wa-call-row { border-top: 1px solid var(--line); }
