:root {
  --sidebar-width: 272px;
  --fb-primary: #4f46e5;
  --fb-primary-rgb: 79,70,229;
  --fb-success: #16a34a;
  --fb-danger: #dc2626;
  --fb-warning: #d97706;
  --fb-bg: #f4f7fb;
  --fb-panel: #ffffff;
  --fb-border: #e5eaf1;
  --fb-muted: #64748b;
  --fb-text: #172033;
  --fb-sidebar: #111827;
  --fb-sidebar-muted: #94a3b8;
  --fb-shadow: 0 14px 35px rgba(15,23,42,.075);
}
[data-bs-theme="dark"] {
  --fb-bg: #0b1120;
  --fb-panel: #111827;
  --fb-border: #263247;
  --fb-muted: #94a3b8;
  --fb-text: #e5e7eb;
  --fb-sidebar: #080d18;
  --fb-shadow: 0 18px 45px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: "Hind Siliguri", "Noto Sans Bengali", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--fb-text); background: var(--fb-bg); }
a { text-decoration: none; }
button, input, select, textarea { font: inherit; }
body { font-size: 15px; line-height: 1.55; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6,strong,.btn,.nav-link,.form-label { font-family: "Hind Siliguri", "Noto Sans Bengali", Inter, sans-serif; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(circle at 10% 5%, rgba(var(--fb-primary-rgb),.13), transparent 32%),
  radial-gradient(circle at 95% 90%, rgba(14,165,233,.11), transparent 32%), var(--fb-bg); }
.auth-shell { width: min(100%, 1020px); display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid var(--fb-border); border-radius: 28px; background: var(--fb-panel); box-shadow: var(--fb-shadow); }
.auth-visual { padding: 56px; color: #fff; background: linear-gradient(145deg,#111827,#312e81 55%,#4338ca); position: relative; overflow: hidden; }
.auth-visual::before,.auth-visual::after { content:""; position:absolute; border-radius:50%; background:rgba(255,255,255,.09); }
.auth-visual::before { width:260px; height:260px; right:-110px; top:-80px; }
.auth-visual::after { width:190px; height:190px; left:-70px; bottom:-70px; }
.brand-lockup { display:flex; align-items:center; gap:12px; position:relative; z-index:1; }
.brand-icon { width:46px; height:46px; display:grid; place-items:center; border-radius:15px; background:rgba(255,255,255,.15); font-size:22px; }
.brand-lockup strong { display:block; font-size:18px; letter-spacing:-.02em; }
.brand-lockup small { color:rgba(255,255,255,.67); }
.auth-visual h1 { margin:80px 0 16px; max-width:560px; font-size:clamp(34px,5vw,54px); line-height:1.04; letter-spacing:-.045em; position:relative; z-index:1; }
.auth-visual p { max-width:520px; color:rgba(255,255,255,.72); font-size:16px; line-height:1.75; position:relative; z-index:1; }
.auth-features { display:grid; gap:12px; margin-top:34px; position:relative; z-index:1; }
.auth-feature { display:flex; gap:12px; align-items:center; color:rgba(255,255,255,.86); font-size:14px; }
.auth-feature i { width:28px; height:28px; display:grid; place-items:center; border-radius:9px; background:rgba(255,255,255,.11); }
.auth-form-wrap { padding:56px; display:flex; flex-direction:column; justify-content:center; }
.auth-kicker,.topbar-kicker,.panel-kicker,.eyebrow { text-transform:uppercase; letter-spacing:.13em; font-size:11px; font-weight:800; color:var(--fb-primary); }
.auth-form-wrap h2 { margin:8px 0 8px; font-weight:800; letter-spacing:-.03em; }
.auth-form-wrap .lead { color:var(--fb-muted); font-size:14px; margin-bottom:28px; }
.form-control,.form-select { min-height:46px; border-color:var(--fb-border); background-color:var(--fb-panel); color:var(--fb-text); border-radius:12px; }
.form-control:focus,.form-select:focus { border-color:rgba(var(--fb-primary-rgb),.65); box-shadow:0 0 0 .22rem rgba(var(--fb-primary-rgb),.12); background-color:var(--fb-panel); color:var(--fb-text); }
.form-label { font-size:13px; font-weight:700; }
.btn { border-radius:11px; font-weight:700; }
.btn-primary { --bs-btn-bg:var(--fb-primary); --bs-btn-border-color:var(--fb-primary); --bs-btn-hover-bg:#4338ca; --bs-btn-hover-border-color:#4338ca; }
.auth-error { display:none; border-radius:12px; padding:12px 14px; margin-bottom:16px; font-size:14px; background:rgba(220,38,38,.1); color:#ef4444; border:1px solid rgba(220,38,38,.18); }
.auth-error.show { display:block; }
.theme-float { position:fixed; top:20px; right:20px; z-index:5; }

.app-shell { min-height:100vh; }
.sidebar { position:fixed; inset:0 auto 0 0; z-index:1030; width:var(--sidebar-width); display:flex; flex-direction:column; padding:20px 16px; background:var(--fb-sidebar); color:#fff; transition:transform .25s ease; }
.sidebar-brand { display:flex; align-items:center; gap:12px; padding:8px 10px 24px; }
.sidebar-brand .brand-mark { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(145deg,#6366f1,#4338ca); box-shadow:0 10px 24px rgba(79,70,229,.35); }
.sidebar-brand strong { display:block; font-size:17px; }
.sidebar-brand small { display:block; color:var(--fb-sidebar-muted); font-size:11px; margin-top:2px; }
.sidebar-nav { display:flex; flex-direction:column; gap:5px; }
.sidebar-nav .nav-link { width:100%; border:0; background:transparent; color:var(--fb-sidebar-muted); display:flex; align-items:center; gap:12px; padding:12px 13px; border-radius:12px; font-size:14px; font-weight:650; text-align:left; transition:.18s ease; }
.sidebar-nav .nav-link i { font-size:17px; }
.sidebar-nav .nav-link:hover { color:#fff; background:rgba(255,255,255,.065); }
.sidebar-nav .nav-link.active { color:#fff; background:linear-gradient(90deg,rgba(99,102,241,.3),rgba(99,102,241,.12)); box-shadow:inset 3px 0 #818cf8; }
.nav-badge { margin-left:auto; min-width:24px; height:22px; padding:0 7px; display:grid; place-items:center; border-radius:999px; background:rgba(255,255,255,.1); font-size:11px; }
.sidebar-footer { margin-top:auto; padding:12px 4px 2px; }
.system-pill { display:flex; align-items:center; gap:10px; padding:12px; border-radius:14px; background:rgba(255,255,255,.05); }
.system-pill strong,.system-pill small { display:block; }
.system-pill strong { font-size:12px; }
.system-pill small { color:var(--fb-sidebar-muted); font-size:10px; margin-top:2px; }
.status-dot { width:9px; height:9px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 5px rgba(34,197,94,.12); }
.workspace { margin-left:var(--sidebar-width); min-height:100vh; }
.topbar { height:82px; position:sticky; top:0; z-index:1020; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:0 30px; border-bottom:1px solid var(--fb-border); background:color-mix(in srgb,var(--fb-panel) 92%,transparent); backdrop-filter:blur(16px); }
.topbar h1 { font-size:23px; margin:2px 0 0; letter-spacing:-.035em; font-weight:800; }
.topbar-actions { display:flex; align-items:center; gap:10px; }
.icon-button { width:42px; height:42px; border:1px solid var(--fb-border); border-radius:12px; background:var(--fb-panel); color:var(--fb-text); display:grid; place-items:center; }
.icon-button:hover { background:rgba(var(--fb-primary-rgb),.08); color:var(--fb-primary); }
.user-chip { display:flex; align-items:center; gap:10px; padding:5px 10px 5px 5px; border:1px solid var(--fb-border); border-radius:14px; background:var(--fb-panel); }
.user-avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; color:#fff; background:linear-gradient(145deg,#6366f1,#4338ca); font-weight:800; }
.user-chip strong,.user-chip small { display:block; line-height:1.2; }
.user-chip strong { font-size:12px; }
.user-chip small { color:var(--fb-muted); font-size:10px; margin-top:3px; }
.content-area { padding:28px 30px 44px; }
.app-view { display:none; animation:fadeIn .18s ease; }
.app-view.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.hero-card { min-height:190px; padding:30px; border-radius:22px; color:#fff; background:linear-gradient(125deg,#111827,#312e81 58%,#4f46e5); display:flex; justify-content:space-between; align-items:flex-end; gap:28px; overflow:hidden; position:relative; box-shadow:var(--fb-shadow); }
.hero-card::after { content:""; position:absolute; width:300px; height:300px; right:-90px; top:-125px; border-radius:50%; background:rgba(255,255,255,.08); }
.hero-card > * { position:relative; z-index:1; }
.hero-card h2 { max-width:720px; margin:8px 0 10px; font-size:clamp(25px,4vw,39px); font-weight:800; line-height:1.08; letter-spacing:-.04em; }
.hero-card p { max-width:720px; margin:0; color:rgba(255,255,255,.67); }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.metric-card { min-height:122px; padding:20px; display:flex; align-items:center; gap:15px; border:1px solid var(--fb-border); border-radius:18px; background:var(--fb-panel); box-shadow:var(--fb-shadow); }
.metric-icon { width:48px; height:48px; flex:0 0 48px; border-radius:15px; display:grid; place-items:center; font-size:20px; }
.metric-card span,.metric-card small,.panel-kicker { display:block; }
.metric-card span { color:var(--fb-muted); font-size:12px; font-weight:700; }
.metric-card strong { display:block; margin-top:3px; font-size:27px; line-height:1; letter-spacing:-.04em; }
.metric-card small { margin-top:7px; color:var(--fb-muted); font-size:10px; }
.panel { border:1px solid var(--fb-border); border-radius:18px; background:var(--fb-panel); box-shadow:var(--fb-shadow); overflow:hidden; }
.panel-header { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px 22px; border-bottom:1px solid var(--fb-border); }
.panel-header h3 { margin:4px 0 0; font-size:17px; font-weight:800; letter-spacing:-.02em; }
.panel-body { padding:22px; }
.section-toolbar { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:20px; }
.section-toolbar h2 { margin:5px 0 5px; font-weight:800; letter-spacing:-.035em; }
.section-toolbar p { margin:0; color:var(--fb-muted); }
.status-card { height:100%; padding:24px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding-bottom: 70px;}
.qr-stage { width:256px; min-height:256px; margin:18px auto; display:grid; place-items:center; padding:18px; border:1px solid var(--fb-border); border-radius:20px; background:#fff; }
.qr-stage img,.qr-stage canvas { max-width:220px !important; height:auto !important; }
.state-badge { display:inline-flex; align-items:center; gap:7px; border-radius:999px; padding:7px 11px; font-size:11px; font-weight:800; }
.state-badge::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.state-connected { color:#15803d; background:rgba(22,163,74,.11); }
.state-waiting_qr,.state-qr_retrying,.state-starting { color:#b45309; background:rgba(217,119,6,.11); }
.state-error,.state-disconnected,.state-logged_out { color:#b91c1c; background:rgba(220,38,38,.1); }
.state-reconnecting,.state-logging_out { color:#0369a1; background:rgba(2,132,199,.1); }
.table { color:var(--fb-text); --bs-table-bg:transparent; --bs-table-color:var(--fb-text); --bs-table-border-color:var(--fb-border); }
.table thead th { color:var(--fb-muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; font-weight:800; background:color-mix(in srgb,var(--fb-bg) 55%,var(--fb-panel)); white-space:nowrap; }
.table td { vertical-align:middle; font-size:13px; }
.table-actions { display:flex; gap:6px; justify-content:flex-end; }
.code-chip { display:inline-flex; max-width:100%; padding:6px 9px; border-radius:9px; color:#4f46e5; background:rgba(var(--fb-primary-rgb),.08); font:600 12px ui-monospace,SFMono-Regular,Menlo,monospace; word-break:break-all; }
[data-bs-theme="dark"] .code-chip { color:#a5b4fc; }
.pattern-grid,.key-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.pattern-card,.key-card,.doc-card { border:1px solid var(--fb-border); border-radius:16px; background:var(--fb-panel); padding:18px; }
.pattern-card:hover,.key-card:hover { border-color:rgba(var(--fb-primary-rgb),.4); box-shadow:0 10px 25px rgba(15,23,42,.06); }
.empty-state { min-height:220px; display:grid; place-items:center; text-align:center; color:var(--fb-muted); padding:30px; }
.empty-state i { font-size:36px; display:block; margin-bottom:8px; }
.setting-card { border:1px solid var(--fb-border); border-radius:16px; padding:20px; height:100%; background:var(--fb-panel); }
.setting-card .setting-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; background:rgba(var(--fb-primary-rgb),.1); color:var(--fb-primary); font-size:18px; }
.docs-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.doc-card h3 { font-size:15px; font-weight:800; }
.doc-card p,.doc-card li { color:var(--fb-muted); font-size:13px; line-height:1.65; }
.doc-card code { color:var(--fb-primary); }
.modal-content { border:1px solid var(--fb-border); border-radius:18px; background:var(--fb-panel); color:var(--fb-text); box-shadow:0 25px 70px rgba(15,23,42,.22); }
.modal-header,.modal-footer { border-color:var(--fb-border); }
.toast-container { z-index:2000; }
.toast { border:1px solid var(--fb-border); border-radius:14px; background:var(--fb-panel); color:var(--fb-text); box-shadow:var(--fb-shadow); }
.spinner-soft { width:34px; height:34px; border:3px solid rgba(var(--fb-primary-rgb),.15); border-top-color:var(--fb-primary); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.dataTables_wrapper .dt-search input,.dataTables_wrapper .dt-length select { border:1px solid var(--fb-border)!important; border-radius:9px!important; background:var(--fb-panel)!important; color:var(--fb-text)!important; }
.dynamic-type-box { padding:16px; border:1px dashed rgba(var(--fb-primary-rgb),.35); border-radius:14px; background:rgba(var(--fb-primary-rgb),.035); }
.dynamic-type-box textarea { min-height:60px; resize:vertical; }

@media(max-width:1199.98px){ .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pattern-grid,.docs-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:991.98px){ .sidebar{transform:translateX(-100%)}.sidebar.open{transform:none;box-shadow:20px 0 50px rgba(0,0,0,.25)}.workspace{margin-left:0}.content-area{padding:22px 18px 38px}.topbar{padding:0 18px}.auth-shell{grid-template-columns:1fr}.auth-visual{display:none}.auth-form-wrap{padding:38px}.key-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:767.98px){ .metric-grid,.pattern-grid,.docs-grid,.key-grid{grid-template-columns:1fr}.hero-card{align-items:flex-start;flex-direction:column}.section-toolbar{align-items:flex-start;flex-direction:column}.content-area{padding:18px 13px 34px}.topbar{height:72px}.topbar h1{font-size:19px}.auth-form-wrap{padding:30px 22px}.qr-stage{width:230px;min-height:230px}.metric-card{min-height:105px}.panel-header{align-items:flex-start;flex-direction:column} }

/* Bangla dashboard additions */
.admin-view { display:none; animation:fadeIn .18s ease; }
.admin-view.active { display:block; }
.bulk-toolbar { display:flex; align-items:center; gap:16px; padding:14px 18px; border-bottom:1px solid var(--fb-border); background:color-mix(in srgb,var(--fb-bg) 45%,var(--fb-panel)); }
.connection-success { width:112px; height:112px; display:grid; place-items:center; border-radius:32px; color:#fff; background:linear-gradient(145deg,#22c55e,#15803d); font-size:54px; box-shadow:0 18px 40px rgba(22,163,74,.25); }
.docs-grid-wide { grid-template-columns:repeat(3,minmax(0,1fr)); }
.monitor-table { min-width:1050px; }
.monitor-table td { vertical-align:top; }
.monitor-jid { display:inline-block; max-width:235px; color:var(--fb-primary); font-size:11px; word-break:break-all; }
.monitor-message { max-width:430px; min-width:220px; white-space:pre-wrap; word-break:break-word; line-height:1.5; font-size:13px; }
.form-check-input:checked { background-color:var(--fb-primary); border-color:var(--fb-primary); }
.setting-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; background:rgba(var(--fb-primary-rgb),.1); color:var(--fb-primary); font-size:18px; }

@media(max-width:1199.98px){ .docs-grid-wide{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:767.98px){ .bulk-toolbar{align-items:flex-start;flex-direction:column}.bulk-toolbar .ms-auto{margin-left:0!important;width:100%;justify-content:space-between}.docs-grid-wide{grid-template-columns:1fr} }

.qr-error { min-height:190px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:18px; color:#b45309; text-align:center; font-size:13px; font-weight:600; }
.qr-error i { font-size:26px; animation:spin 1.2s linear infinite; }

/* Automation suite and analytics */
.automation-center { overflow:visible; }
.automation-header { align-items:flex-end; }
.module-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; padding:18px; }
.module-card { min-width:0; min-height:118px; display:grid; grid-template-columns:48px 1fr auto; align-items:center; gap:14px; padding:18px; border:1px solid var(--fb-border); border-radius:16px; background:color-mix(in srgb,var(--fb-panel) 92%,var(--fb-bg)); cursor:pointer; transition:.18s ease; }
.module-card:hover { border-color:rgba(var(--fb-primary-rgb),.34); transform:translateY(-2px); box-shadow:0 12px 28px rgba(15,23,42,.07); }
.module-card:has(input:not(:checked)) { opacity:.7; background:color-mix(in srgb,var(--fb-bg) 68%,var(--fb-panel)); }
.module-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:15px; color:#fff; font-size:20px; }
.module-direct .module-icon { background:linear-gradient(145deg,#6366f1,#4338ca); }
.module-forward .module-icon { background:linear-gradient(145deg,#0ea5e9,#0369a1); }
.module-website .module-icon { background:linear-gradient(145deg,#22c55e,#15803d); }
.module-copy { min-width:0; }
.module-copy strong,.module-copy small { display:block; }
.module-copy strong { font-size:15px; }
.module-copy small { margin-top:6px; color:var(--fb-muted); font-size:11px; line-height:1.5; }
.module-card .form-switch { display:flex; flex-direction:column; align-items:center; gap:4px; padding:0; margin:0; }
.module-card .form-switch .form-check-input { width:2.75rem; height:1.42rem; margin:0; cursor:pointer; }
.module-state { color:#15803d; font:800 9px Inter,sans-serif; letter-spacing:.06em; }
.module-card:has(input:not(:checked)) .module-state { color:var(--fb-muted); }
.chart-panel { min-height:420px; }
.chart-legend { display:flex; flex-wrap:wrap; gap:12px; color:var(--fb-muted); font:700 10px Inter,sans-serif; }
.chart-legend span { display:flex; align-items:center; gap:5px; }
.chart-legend i { width:9px; height:9px; display:block; border-radius:3px; }
.legend-sales { background:#6366f1; }
.legend-profit { background:#10b981; }
.legend-jobs { background:#0ea5e9; border-radius:50%!important; }
.analytics-summary { display:flex; flex-wrap:wrap; gap:8px; padding:14px 22px 0; }
.analytics-summary span { padding:7px 10px; border:1px solid var(--fb-border); border-radius:10px; color:var(--fb-muted); background:var(--fb-bg); font-size:10px; }
.analytics-summary strong { color:var(--fb-text); font-size:11px; }
.performance-chart { min-height:305px; padding:12px 15px 18px; overflow-x:auto; overflow-y:hidden; }
.performance-chart svg { display:block; width:100%; min-width:680px; height:285px; }
.performance-chart .chart-grid-line { stroke:color-mix(in srgb,var(--fb-border) 78%,transparent); stroke-width:1; }
.performance-chart .chart-axis-label { fill:var(--fb-muted); font:600 9px Inter,sans-serif; }
.performance-chart .chart-sales-bar { fill:#6366f1; opacity:.77; }
.performance-chart .chart-sales-bar:hover { opacity:1; }
.performance-chart .chart-profit-path { fill:none; stroke:#10b981; stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }
.performance-chart .chart-job-path { fill:none; stroke:#0ea5e9; stroke-width:2; stroke-dasharray:5 5; stroke-linejoin:round; stroke-linecap:round; }
.performance-chart .chart-profit-dot { fill:#10b981; stroke:var(--fb-panel); stroke-width:2; }
.performance-chart .chart-job-dot { fill:#0ea5e9; stroke:var(--fb-panel); stroke-width:2; }
.chart-loading { min-height:270px; display:flex; align-items:center; justify-content:center; gap:12px; color:var(--fb-muted); font-size:12px; }
.chart-loading .spinner-soft { width:23px; height:23px; }
.donut-layout { min-height:260px; display:grid; grid-template-columns:150px 1fr; align-items:center; gap:20px; padding:26px 22px 10px; }
.donut-chart { width:150px; height:150px; position:relative; display:grid; place-items:center; border-radius:50%; background:conic-gradient(#e2e8f0 0 100%); }
.donut-chart::after { content:""; position:absolute; width:98px; height:98px; border-radius:50%; background:var(--fb-panel); box-shadow:0 0 0 1px var(--fb-border); }
.donut-chart > div { position:relative; z-index:1; text-align:center; }
.donut-chart strong,.donut-chart small { display:block; }
.donut-chart strong { font:800 25px Inter,sans-serif; }
.donut-chart small { color:var(--fb-muted); font:650 9px Inter,sans-serif; text-transform:uppercase; }
.donut-legend { display:grid; gap:9px; }
.donut-legend > div { display:grid; grid-template-columns:9px 1fr auto; align-items:center; gap:8px; font-size:11px; }
.donut-legend i { width:9px; height:9px; border-radius:50%; }
.donut-legend span { color:var(--fb-muted); }
.donut-legend strong { font:750 10px Inter,sans-serif; }
.activity-strip { display:grid; grid-template-columns:1fr 1fr; gap:1px; margin:10px 22px 22px; overflow:hidden; border:1px solid var(--fb-border); border-radius:13px; background:var(--fb-border); }
.activity-strip > div { padding:12px 14px; background:var(--fb-bg); }
.activity-strip span,.activity-strip strong { display:block; }
.activity-strip span { color:var(--fb-muted); font-size:10px; }
.activity-strip strong { margin-top:2px; font:800 18px Inter,sans-serif; }
.direct-api-settings .panel-header { align-items:flex-start; }
.endpoint-stack { height:100%; display:flex; flex-direction:column; gap:10px; }
.endpoint-stack > div { padding:14px; border:1px solid var(--fb-border); border-radius:13px; background:var(--fb-bg); }
.endpoint-stack span,.endpoint-stack code { display:block; }
.endpoint-stack span { color:var(--fb-muted); font:800 9px Inter,sans-serif; letter-spacing:.08em; }
.endpoint-stack code { margin-top:6px; color:var(--fb-primary); font-size:11px; overflow-wrap:anywhere; }
.endpoint-stack .btn { margin-top:auto; }

@media(max-width:1199.98px) {
  .module-grid { grid-template-columns:1fr; }
  .module-card { min-height:96px; }
}
@media(max-width:767.98px) {
  .automation-header { align-items:flex-start; }
  .automation-header > .d-flex { width:100%; justify-content:space-between; }
  .module-grid { padding:12px; gap:10px; }
  .module-card { grid-template-columns:42px 1fr auto; gap:11px; padding:14px; }
  .module-icon { width:42px; height:42px; border-radius:13px; }
  .chart-panel { min-height:0; }
  .analytics-summary { padding:12px 14px 0; }
  .performance-chart { padding-inline:8px; }
  .donut-layout { grid-template-columns:125px 1fr; gap:15px; padding:22px 15px 8px; }
  .donut-chart { width:125px; height:125px; }
  .donut-chart::after { width:81px; height:81px; }
  .activity-strip { margin-inline:15px; }
}
@media(max-width:420px) {
  .module-card { grid-template-columns:40px 1fr; }
  .module-card .form-switch { grid-column:1/-1; flex-direction:row; justify-content:flex-end; }
  .donut-layout { grid-template-columns:1fr; justify-items:center; }
  .donut-legend { width:100%; }
}

/* Dynamic reaction settings */
.reaction-setting-card { position:relative; overflow:hidden; }
.reaction-setting-card::after { content:""; position:absolute; width:120px; height:120px; right:-55px; bottom:-58px; border-radius:50%; background:rgba(var(--fb-primary-rgb),.055); pointer-events:none; }
.reaction-switch { margin-top:4px; position:relative; z-index:1; }
.reaction-switch .form-check-input { width:2.7rem; height:1.35rem; cursor:pointer; }
.reaction-switch .form-check-label { margin-left:6px; color:var(--fb-muted); font-weight:700; cursor:pointer; }
.reaction-input-group { max-width:360px; }
.reaction-preview { min-width:58px; justify-content:center; font-size:24px; background:color-mix(in srgb,var(--fb-bg) 55%,var(--fb-panel)); }
.emoji-input { font-family:"Noto Color Emoji","Segoe UI Emoji","Apple Color Emoji","Hind Siliguri",sans-serif; font-size:22px; }
.emoji-picker { max-height:420px; overflow:auto; padding:12px; border:1px solid var(--fb-border); border-radius:16px; background:color-mix(in srgb,var(--fb-bg) 72%,var(--fb-panel)); scrollbar-width:thin; }
.emoji-category + .emoji-category { margin-top:14px; padding-top:14px; border-top:1px dashed var(--fb-border); }
.emoji-category-title { margin-bottom:8px; color:var(--fb-muted); font-size:12px; font-weight:800; letter-spacing:.02em; text-transform:uppercase; }
.emoji-presets { display:flex; flex-wrap:wrap; gap:8px; position:relative; z-index:1; }
.emoji-preset { width:42px; height:40px; display:grid; place-items:center; border:1px solid var(--fb-border); border-radius:12px; background:var(--fb-panel); font-family:"Noto Color Emoji","Segoe UI Emoji","Apple Color Emoji",sans-serif; font-size:20px; cursor:pointer; transition:.16s ease; }
.emoji-preset:hover,.emoji-preset:focus-visible { border-color:rgba(var(--fb-primary-rgb),.55); background:rgba(var(--fb-primary-rgb),.08); transform:translateY(-1px); outline:none; box-shadow:0 0 0 3px rgba(var(--fb-primary-rgb),.10); }
@media (max-width:575.98px) { .emoji-picker { max-height:330px; padding:10px; } .emoji-preset { width:39px; height:38px; } }

/* Professional API documentation */
.api-docs-body { --api-sidebar:282px; background:var(--fb-bg); scroll-behavior:smooth; }
.api-docs-sidebar { position:fixed; inset:0 auto 0 0; z-index:1040; width:var(--api-sidebar); display:flex; flex-direction:column; padding:20px 16px; overflow-y:auto; color:#fff; background:#0b1220; border-right:1px solid rgba(148,163,184,.13); transition:transform .24s ease; scrollbar-width:thin; }
.api-docs-brand { display:flex; align-items:center; gap:12px; padding:4px 8px 18px; color:#fff; }
.api-docs-brand .brand-mark { width:43px; height:43px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(145deg,#6366f1,#4338ca); box-shadow:0 10px 26px rgba(79,70,229,.33); font-size:19px; }
.api-docs-brand strong,.api-docs-brand small { display:block; }
.api-docs-brand strong { font-family:Inter,sans-serif; font-size:15px; letter-spacing:-.02em; }
.api-docs-brand small { margin-top:2px; color:#94a3b8; font:600 10px Inter,sans-serif; }
.api-version-pill { display:flex; align-items:center; gap:9px; margin:0 7px 20px; padding:10px 12px; border:1px solid rgba(148,163,184,.12); border-radius:11px; color:#cbd5e1; background:rgba(255,255,255,.035); font:600 11px Inter,sans-serif; }
.api-version-pill .status-dot { width:7px; height:7px; box-shadow:0 0 0 4px rgba(34,197,94,.1); }
.api-docs-nav { display:flex; flex-direction:column; gap:3px; }
.api-nav-label { margin:14px 12px 5px; color:#64748b; font:700 9px Inter,sans-serif; letter-spacing:.13em; text-transform:uppercase; }
.api-docs-nav a { display:flex; align-items:center; gap:10px; padding:9px 11px; border-radius:9px; color:#94a3b8; font-size:12px; font-weight:650; transition:.16s ease; }
.api-docs-nav a i { width:17px; color:#64748b; font-size:14px; }
.api-docs-nav a:hover { color:#e2e8f0; background:rgba(255,255,255,.045); }
.api-docs-nav a.active { color:#fff; background:rgba(99,102,241,.18); box-shadow:inset 2px 0 #818cf8; }
.api-docs-nav a.active i { color:#a5b4fc; }
.api-docs-sidebar-footer { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:auto; padding:22px 6px 2px; }
.api-docs-sidebar-footer a { padding:8px; border:1px solid rgba(148,163,184,.12); border-radius:9px; color:#94a3b8; font-size:10px; text-align:center; }
.api-docs-sidebar-footer a:hover { color:#fff; background:rgba(255,255,255,.045); }
.api-docs-main { min-height:100vh; margin-left:var(--api-sidebar); }
.api-docs-topbar { position:sticky; top:0; z-index:1030; height:70px; display:flex; align-items:center; gap:14px; padding:0 28px; border-bottom:1px solid var(--fb-border); background:color-mix(in srgb,var(--fb-panel) 93%,transparent); backdrop-filter:blur(16px); }
.api-docs-search { max-width:min(620px,55vw); display:flex; align-items:center; gap:10px; color:var(--fb-muted); }
.api-docs-search code { overflow:hidden; color:var(--fb-muted); font:600 11px ui-monospace,SFMono-Regular,Menlo,monospace; text-overflow:ellipsis; white-space:nowrap; }
.api-docs-content { width:min(1120px,calc(100% - 52px)); margin:0 auto; padding:42px 0 80px; }
.api-hero { min-height:390px; display:grid; grid-template-columns:1fr 270px; align-items:end; gap:50px; padding:50px; border-radius:25px; overflow:hidden; position:relative; color:#fff; background:radial-gradient(circle at 95% 15%,rgba(129,140,248,.37),transparent 28%),linear-gradient(135deg,#0b1220,#1e1b4b 58%,#3730a3); box-shadow:0 25px 70px rgba(15,23,42,.17); }
.api-hero::after { content:""; position:absolute; width:360px; height:360px; right:-160px; top:-185px; border:1px solid rgba(255,255,255,.12); border-radius:50%; box-shadow:0 0 0 55px rgba(255,255,255,.025),0 0 0 110px rgba(255,255,255,.018); }
.api-hero > * { position:relative; z-index:1; }
.api-eyebrow { color:#c7d2fe; font:800 10px Inter,sans-serif; letter-spacing:.17em; text-transform:uppercase; }
.api-hero h1 { margin:12px 0 18px; font-family:Inter,"Hind Siliguri",sans-serif; font-size:clamp(42px,7vw,72px); font-weight:800; line-height:.98; letter-spacing:-.06em; }
.api-hero p { max-width:670px; margin:0; color:rgba(255,255,255,.7); font-size:16px; line-height:1.8; }
.btn-api-ghost { color:#fff; border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.06); }
.btn-api-ghost:hover { color:#fff; background:rgba(255,255,255,.13); }
.api-hero-meta { display:grid; gap:1px; overflow:hidden; border:1px solid rgba(255,255,255,.12); border-radius:15px; background:rgba(255,255,255,.08); backdrop-filter:blur(10px); }
.api-hero-meta div { padding:13px 15px; background:rgba(10,18,33,.4); }
.api-hero-meta span,.api-hero-meta strong { display:block; }
.api-hero-meta span { color:rgba(255,255,255,.48); font:700 8px Inter,sans-serif; letter-spacing:.1em; text-transform:uppercase; }
.api-hero-meta strong { margin-top:4px; color:#f8fafc; font:650 11px Inter,sans-serif; }
.api-section { position:relative; padding:88px 0 12px; scroll-margin-top:70px; }
.api-section-index { position:absolute; top:91px; left:-48px; color:color-mix(in srgb,var(--fb-muted) 42%,transparent); font:800 10px Inter,sans-serif; }
.api-section-heading { margin-bottom:26px; }
.api-section-heading > span { color:var(--fb-primary); font:800 9px Inter,sans-serif; letter-spacing:.15em; }
.api-section-heading h2 { margin:7px 0 8px; font-family:Inter,"Hind Siliguri",sans-serif; font-size:clamp(28px,4vw,39px); font-weight:800; letter-spacing:-.045em; }
.api-section-heading p { max-width:760px; margin:0; color:var(--fb-muted); font-size:14px; line-height:1.75; }
.api-step-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.api-step { min-height:190px; padding:17px; border:1px solid var(--fb-border); border-radius:15px; background:var(--fb-panel); }
.api-step b { width:29px; height:29px; display:grid; place-items:center; margin-bottom:35px; border-radius:9px; color:var(--fb-primary); background:rgba(var(--fb-primary-rgb),.1); font:800 11px Inter,sans-serif; }
.api-step strong,.api-step p { display:block; }
.api-step strong { font-size:13px; }
.api-step p { margin:7px 0 0; color:var(--fb-muted); font-size:11px; line-height:1.6; }
.api-flow { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:18px; padding:17px 23px; border:1px dashed rgba(var(--fb-primary-rgb),.35); border-radius:15px; background:rgba(var(--fb-primary-rgb),.035); }
.api-flow > div { display:grid; grid-template-columns:32px auto; grid-template-rows:auto auto; align-items:center; column-gap:10px; }
.api-flow > div > i { grid-row:1/3; width:32px; height:32px; display:grid; place-items:center; border-radius:10px; color:var(--fb-primary); background:rgba(var(--fb-primary-rgb),.1); }
.api-flow strong { font-size:12px; }
.api-flow small { color:var(--fb-muted); font-size:9px; }
.api-flow > i { color:var(--fb-muted); font-size:12px; }
.api-note { display:flex; align-items:flex-start; gap:13px; padding:15px 17px; border:1px solid var(--fb-border); border-radius:14px; background:var(--fb-panel); }
.api-note > i { width:31px; height:31px; flex:0 0 31px; display:grid; place-items:center; border-radius:9px; }
.api-note strong,.api-note p { display:block; }
.api-note strong { font-size:13px; }
.api-note p { margin:3px 0 0; color:var(--fb-muted); font-size:12px; line-height:1.65; }
.api-note-info { border-color:rgba(79,70,229,.2); background:rgba(var(--fb-primary-rgb),.035); }
.api-note-info > i { color:var(--fb-primary); background:rgba(var(--fb-primary-rgb),.1); }
.api-note-warning { border-color:rgba(217,119,6,.2); background:rgba(217,119,6,.035); }
.api-note-warning > i { color:#d97706; background:rgba(217,119,6,.11); }
.api-endpoint-card { padding:20px 22px; border:1px solid var(--fb-border); border-radius:15px; background:var(--fb-panel); }
.api-endpoint-card.endpoint-primary { border-color:rgba(var(--fb-primary-rgb),.25); box-shadow:inset 3px 0 var(--fb-primary); }
.api-endpoint-title { display:flex; align-items:center; gap:12px; min-width:0; }
.api-endpoint-title code { overflow-wrap:anywhere; color:var(--fb-text); font:650 13px ui-monospace,SFMono-Regular,Menlo,monospace; }
.api-endpoint-card p { margin:13px 0 0; color:var(--fb-muted); font-size:12px; line-height:1.65; }
.api-endpoint-badges { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.api-endpoint-badges span { padding:5px 8px; border-radius:7px; color:var(--fb-muted); background:var(--fb-bg); font:600 9px Inter,sans-serif; }
.method { flex:0 0 auto; display:inline-grid; place-items:center; min-width:48px; height:25px; padding:0 8px; border-radius:7px; font:800 8px Inter,sans-serif; letter-spacing:.04em; }
.method-post { color:#15803d; background:rgba(22,163,74,.11); }
.method-header { min-width:90px; color:#4338ca; background:rgba(var(--fb-primary-rgb),.11); }
.api-code-tabs { overflow:hidden; border:1px solid #243044; border-radius:14px; background:#0b1220; box-shadow:0 12px 35px rgba(15,23,42,.08); }
.api-code-head { height:42px; display:flex; align-items:center; justify-content:space-between; padding:0 14px; border-bottom:1px solid rgba(148,163,184,.12); color:#94a3b8; background:#101827; font:650 9px Inter,sans-serif; letter-spacing:.04em; }
.api-copy { border:0; color:#94a3b8; background:transparent; font:600 9px Inter,sans-serif; }
.api-copy:hover,.api-copy.copied { color:#c7d2fe; }
.api-code-tabs pre,.api-response-card pre { margin:0; padding:19px; overflow:auto; color:#dbeafe; background:transparent; font:500 11px/1.75 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; tab-size:2; }
.api-code-tabs code,.api-response-card code { color:inherit; }
.api-subheading { margin:29px 0 11px; font:800 16px Inter,"Hind Siliguri",sans-serif; letter-spacing:-.02em; }
.api-reference-table { overflow:hidden; margin:0; border:1px solid var(--fb-border); border-radius:14px; }
.api-reference-table th { padding:12px 14px; font-size:9px; }
.api-reference-table td { padding:13px 14px; color:var(--fb-muted); font-size:11px; line-height:1.6; }
.api-reference-table td code { color:var(--fb-primary); font-weight:700; }
.required-pill { padding:3px 7px; border-radius:999px; color:#15803d; background:rgba(22,163,74,.1); font:700 8px Inter,sans-serif; }
.api-response-card { height:100%; overflow:hidden; border:1px solid var(--fb-border); border-radius:14px; background:var(--fb-panel); }
.api-response-card > div { display:flex; align-items:center; gap:11px; padding:14px 16px; border-bottom:1px solid var(--fb-border); }
.api-response-card > div span { padding:4px 7px; border-radius:7px; font:800 9px Inter,sans-serif; }
.api-response-card > div strong { font-size:12px; }
.api-response-card pre { min-height:203px; color:#cbd5e1; background:#0b1220; }
.response-success > div span { color:#15803d; background:rgba(22,163,74,.1); }
.response-neutral > div span { color:#4338ca; background:rgba(var(--fb-primary-rgb),.1); }
.api-small-note { margin:15px 0 0; color:var(--fb-muted); font-size:11px; line-height:1.65; }
.api-callback-list { display:grid; gap:10px; }
.api-callback-list article { padding:18px 20px; border:1px solid var(--fb-border); border-radius:14px; background:var(--fb-panel); }
.api-callback-list article > div { display:flex; align-items:center; gap:12px; }
.api-callback-list code { color:var(--fb-text); font:650 12px ui-monospace,SFMono-Regular,Menlo,monospace; word-break:break-all; }
.api-callback-list p { margin:11px 0 0 60px; color:var(--fb-muted); font-size:11px; line-height:1.65; }
.api-type-table tbody { counter-reset:type-row; }
.api-type-table tbody tr { counter-increment:type-row; }
.api-type-table .type-index::before { content:counter(type-row,decimal-leading-zero); color:var(--fb-muted); font:700 9px Inter,sans-serif; }
.api-command-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.api-command-grid article { min-height:210px; padding:20px; border:1px solid var(--fb-border); border-radius:15px; background:var(--fb-panel); }
.api-command-grid article > i { width:39px; height:39px; display:grid; place-items:center; margin-bottom:25px; border-radius:12px; color:var(--fb-primary); background:rgba(var(--fb-primary-rgb),.1); font-size:17px; }
.api-command-grid strong,.api-command-grid code { display:block; }
.api-command-grid strong { font-size:13px; }
.api-command-grid code { margin-top:8px; color:var(--fb-primary); font-size:11px; overflow-wrap:anywhere; }
.api-command-grid p { margin:10px 0 0; color:var(--fb-muted); font-size:11px; line-height:1.65; }
.api-check-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.api-check-grid > div { display:flex; align-items:flex-start; gap:12px; padding:16px; border:1px solid var(--fb-border); border-radius:13px; background:var(--fb-panel); }
.api-check-grid > div > i { width:25px; height:25px; flex:0 0 25px; display:grid; place-items:center; border-radius:8px; color:#15803d; background:rgba(22,163,74,.1); }
.api-check-grid strong,.api-check-grid small { display:block; }
.api-check-grid strong { font-size:12px; }
.api-check-grid small { margin-top:4px; color:var(--fb-muted); font-size:10px; line-height:1.55; }
.api-accordion .accordion-item { overflow:hidden; margin-bottom:8px; border:1px solid var(--fb-border); border-radius:13px; background:var(--fb-panel); color:var(--fb-text); }
.api-accordion .accordion-button { padding:15px 17px; color:var(--fb-text); background:var(--fb-panel); box-shadow:none; font-size:12px; font-weight:750; }
.api-accordion .accordion-button:not(.collapsed) { color:var(--fb-primary); background:rgba(var(--fb-primary-rgb),.045); }
.api-accordion .accordion-body { padding:5px 17px 17px; color:var(--fb-muted); font-size:11px; line-height:1.7; }
.api-final-card { margin-top:80px; padding:34px; display:flex; align-items:flex-end; justify-content:space-between; gap:30px; border-radius:20px; color:#fff; background:linear-gradient(120deg,#111827,#312e81); }
.api-final-card span { color:#a5b4fc; font:800 9px Inter,sans-serif; letter-spacing:.13em; text-transform:uppercase; }
.api-final-card h2 { margin:8px 0; font:800 27px Inter,"Hind Siliguri",sans-serif; letter-spacing:-.04em; }
.api-final-card p { max-width:700px; margin:0; color:rgba(255,255,255,.62); font-size:12px; line-height:1.65; }
.api-final-card .btn { flex:0 0 auto; }
.api-docs-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:24px max(26px,calc((100% - 1120px)/2)); border-top:1px solid var(--fb-border); color:var(--fb-muted); font-size:10px; }
.api-docs-footer a { color:var(--fb-primary); font-weight:700; }
.api-docs-overlay { display:none; position:fixed; inset:0; z-index:1035; background:rgba(2,6,23,.58); backdrop-filter:blur(2px); }

@media(max-width:1199.98px) {
  .api-docs-sidebar { transform:translateX(-100%); box-shadow:22px 0 55px rgba(0,0,0,.25); }
  .api-docs-sidebar.open { transform:none; }
  .api-docs-overlay.show { display:block; }
  .api-docs-main { margin-left:0; }
  .api-section-index { display:none; }
  .api-step-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:767.98px) {
  .api-docs-topbar { height:64px; padding:0 14px; }
  .api-docs-search { max-width:48vw; }
  .api-docs-content { width:calc(100% - 26px); padding-top:18px; }
  .api-hero { min-height:0; grid-template-columns:1fr; gap:30px; padding:30px 24px; border-radius:19px; }
  .api-hero h1 { font-size:42px; }
  .api-hero p { font-size:14px; }
  .api-hero-meta { grid-template-columns:1fr 1fr; }
  .api-section { padding-top:65px; scroll-margin-top:64px; }
  .api-step-grid,.api-command-grid,.api-check-grid { grid-template-columns:1fr; }
  .api-step { min-height:0; display:flex; align-items:flex-start; gap:14px; }
  .api-step b { flex:0 0 29px; margin:0; }
  .api-flow { align-items:stretch; flex-direction:column; }
  .api-flow > i { transform:rotate(90deg); align-self:center; }
  .api-callback-list article > div { align-items:flex-start; flex-direction:column; }
  .api-callback-list p { margin-left:0; }
  .api-final-card { align-items:flex-start; flex-direction:column; padding:26px; }
  .api-final-card .btn { width:100%; }
  .api-docs-footer { padding:20px 14px; }
}
