/* ==========================================================================
   SG Reach UI  |  Designed and Developed by Sprite Genix
   Hand-written design system, no build step needed.
   ========================================================================== */

:root {
  --brand: #f7a51c;
  --brand-600: #e08d00;
  --brand-700: #a86800;
  --brand-50: #fff7e8;
  --brand-100: #ffe9bf;
  --ink: #0e0e10;
  --ink-2: #17171a;
  --ink-3: #232328;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f2;
  --border-2: #d6dce8;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8391a7;
  --blue: #2563eb; --blue-50: #eff6ff;
  --red: #dc2626; --red-50: #fef2f2;
  --amber: #d97706; --amber-50: #fffbeb;
  --purple: #7c3aed; --purple-50: #f5f3ff;
  --teal: #0d9488; --teal-50: #f0fdfa;
  --green: #16a34a; --green-50: #f0fdf4;
  --gray-50: #f1f5f9;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .15);
  --sidebar-w: 256px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0a0f1c;
  --surface: #111827;
  --surface-2: #0f1624;
  --border: #1f2a3d;
  --border-2: #2a3850;
  --text: #e8edf5;
  --text-2: #a9b5c8;
  --text-3: #6f7d94;
  --brand-50: rgba(247, 165, 28, .12);
  --brand-100: rgba(247, 165, 28, .2);
  --blue-50: rgba(37, 99, 235, .14);
  --red-50: rgba(220, 38, 38, .14);
  --amber-50: rgba(217, 119, 6, .14);
  --purple-50: rgba(124, 58, 237, .16);
  --teal-50: rgba(13, 148, 136, .16);
  --green-50: rgba(22, 163, 74, .14);
  --gray-50: #172033;
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; } h5 { font-size: 13px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--ink); color: #d6e2f5; padding: 14px 16px; border-radius: var(--radius-sm); overflow: auto; }
code { background: var(--gray-50); padding: 1px 6px; border-radius: 5px; }
pre code { background: none; padding: 0; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.ic-sm { width: 15px; height: 15px; flex-shrink: 0; }
.ic-lg { width: 24px; height: 24px; flex-shrink: 0; }
[x-cloak] { display: none !important; }

/* ------------------------------------------------------------- app layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--ink); color: #c8d3e6; position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: #fff; font-weight: 800; font-size: 17px; }
.sidebar-brand img { height: 34px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 10.5px; font-weight: 600; color: #8b8b93; letter-spacing: .02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #ffc65c); display: grid; place-items: center; color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: #24304a transparent; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5f6f8c; padding: 16px 10px 6px; font-weight: 700; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8.5px 10px; border-radius: 9px; color: #b4c0d6;
  font-weight: 500; font-size: 13.5px; text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--ink-3); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(247,165,28,.2), rgba(247,165,28,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav-link .ic { width: 17px; height: 17px; opacity: .9; }
.nav-link .count { margin-left: auto; background: var(--brand); color: #111; font-size: 11px; padding: 0 7px; border-radius: 99px; font-weight: 700; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid #1a2438; font-size: 12px; color: #6f7f9b; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 26px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.topbar .grow { flex: 1; }
.page { padding: 26px; flex: 1; }
.page-narrow { max-width: 920px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .sub { color: var(--text-2); margin: 4px 0 0; font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-footer { padding: 16px 26px; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.sg-credit { font-weight: 700; color: var(--brand-700); }
.menu-btn { display: none; }
.impersonate-bar { background: var(--amber); color: #fff; padding: 8px 26px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.impersonate-bar a, .impersonate-bar button { color: #fff; text-decoration: underline; background: none; border: 0; font: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3, .card-head h4 { margin: 0; font-size: 15px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card + .card { margin-top: 18px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon .ic { width: 20px; height: 20px; }
.stat-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--text-3); }
.tint-green { background: var(--green-50); color: var(--green); }
.tint-blue { background: var(--blue-50); color: var(--blue); }
.tint-purple { background: var(--purple-50); color: var(--purple); }
.tint-amber { background: var(--amber-50); color: var(--amber); }
.tint-red { background: var(--red-50); color: var(--red); }
.tint-teal { background: var(--teal-50); color: var(--teal); }
.tint-brand { background: var(--brand-50); color: var(--brand-600); }

/* ------------------------------------------------------------------- grid */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.g-side-l { grid-template-columns: 260px minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.flex { display: flex; } .inline-flex { display: inline-flex; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; min-width: 0; } .shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.p-0 { padding: 0 !important; } .p-3 { padding: 12px; } .p-4 { padding: 16px; }
.w-full { width: 100%; } .h-full { height: 100%; }
.text-right { text-align: right; } .text-center { text-align: center; }
.text-xs { font-size: 12px; } .text-sm { font-size: 13px; } .text-lg { font-size: 16px; } .text-xl { font-size: 20px; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-brand { color: var(--brand-700); } .text-amber { color: var(--amber); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.block { display: block; }
.relative { position: relative; }
.rounded { border-radius: var(--radius-sm); }
.border-top { border-top: 1px solid var(--border); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); } .dot-red { background: var(--red); } .dot-amber { background: var(--amber); } .dot-gray { background: var(--text-3); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 9px;
  font: 600 13.5px/1.2 var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #111; box-shadow: 0 1px 2px rgba(168,104,0,.3), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-primary:hover { background: var(--brand-600); color: #111; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-50); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-soft { background: var(--red-50); color: var(--red); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .btn-soft { color: #fcc96b; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { padding: 4px 8px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 11px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 5px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-700); cursor: pointer; font: inherit; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-danger { color: var(--red); }

/* ------------------------------------------------------------------ forms */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
label, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; padding: 9.5px 12px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface);
  color: var(--text); font: 14px/1.4 var(--font); transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(247,165,28,.22); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-sm { padding: 6px 10px; font-size: 13px; }
.textarea { min-height: 96px; resize: vertical; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238391a7' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
select[multiple].select { background-image: none; padding-right: 12px; min-height: 110px; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .btn, .input-group .addon { border-radius: 0 9px 9px 0; }
.addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border-2); border-left: 0; color: var(--text-2); font-size: 13px; }
.addon-left { border-left: 1px solid var(--border-2); border-right: 0; border-radius: 9px 0 0 9px; }
.input-group .addon-left + .input { border-radius: 0 9px 9px 0; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; background: var(--border-2); border-radius: 99px; position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(247,165,28,.3); }
.radio-cards { display: grid; gap: 10px; }
.radio-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; transition: border-color .15s, background .15s; margin: 0; font-weight: 400; }
.radio-card:hover { border-color: var(--border-2); }
.radio-card input { margin-top: 3px; accent-color: var(--brand); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.color-input { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface); cursor: pointer; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; font-size: 13px; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.table-compact td { padding: 8px 14px; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, #64748b, #334155); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }

/* ---------------------------------------------------------- badges/alerts */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.6; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-purple { background: var(--purple-50); color: var(--purple); }
.badge-teal { background: var(--teal-50); color: var(--teal); }
.badge-gray { background: var(--gray-50); color: var(--text-2); }
.badge-dark { background: var(--ink); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 7px; background: var(--gray-50); font-size: 12px; font-weight: 600; color: var(--text-2); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; border: 1px solid transparent; }
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--green-50); color: #166534; border-color: rgba(22,163,74,.2); }
.alert-error { background: var(--red-50); color: #991b1b; border-color: rgba(220,38,38,.2); }
.alert-warning { background: var(--amber-50); color: #92400e; border-color: rgba(217,119,6,.22); }
.alert-info { background: var(--blue-50); color: #1e40af; border-color: rgba(37,99,235,.2); }
[data-theme="dark"] .alert-success { color: #86efac; } [data-theme="dark"] .alert-error { color: #fca5a5; }
[data-theme="dark"] .alert-warning { color: #fcd34d; } [data-theme="dark"] .alert-info { color: #93c5fd; }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; min-width: 240px; max-width: 380px; animation: slideUp .2s ease; display: flex; gap: 10px; align-items: center; }
.toast-success { border-left: 4px solid var(--brand); } .toast-error { border-left: 4px solid var(--red); }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------- tabs/menus/modal */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; display: inline-flex; gap: 7px; align-items: center; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; font-size: 13.5px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand); }
.pills { display: inline-flex; background: var(--gray-50); border-radius: 10px; padding: 3px; gap: 2px; }
.pill { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--text-2); text-decoration: none !important; border: 0; background: none; cursor: pointer; font-family: inherit; }
.pill.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.dropdown-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--text); font-size: 13.5px; text-decoration: none !important; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.dropdown-item:hover { background: var(--gray-50); }
.dropdown-item.danger { color: var(--red); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 22, .55); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); animation: slideUp .18s ease; }
.modal-lg { max-width: 760px; } .modal-xl { max-width: 1000px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------- misc components */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; }
.empty .empty-icon .ic { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 16px; }
.pagination { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.page-link { min-width: 32px; height: 32px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; border: 1px solid var(--border); text-decoration: none !important; }
.page-link.active { background: var(--brand); color: #111; border-color: var(--brand); }
.page-link:hover:not(.active) { background: var(--gray-50); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 170px; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search-box .input { padding-left: 34px; }
.progress { height: 8px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }
.copy-field { display: flex; gap: 6px; }
.copy-field .input { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-weight: 800; display: grid; place-items: center; font-size: 12.5px; }
.dns-table td:nth-child(3) { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.feature-list li .ic { color: var(--brand); margin-top: 2px; width: 16px; height: 16px; }
.feature-list li.off { color: var(--text-3); text-decoration: line-through; }
.feature-list li.off .ic { color: var(--text-3); }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--gray-50), var(--border), var(--gray-50)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
.qr-box { width: 260px; height: 260px; border: 1px dashed var(--border-2); border-radius: var(--radius); display: grid; place-items: center; margin: 0 auto; background: #fff; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.wa-preview { background: #e5ddd5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d4cbc2'/%3E%3C/svg%3E"); border-radius: var(--radius); padding: 18px; min-height: 260px; }
.wa-bubble { background: #fff; border-radius: 0 10px 10px 10px; padding: 8px 10px 6px; max-width: 320px; box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: 13.5px; color: #111; word-break: break-word; }
.wa-bubble .wa-body, .wa-bubble > div[x-html] { white-space: pre-wrap; }
.wa-bubble .wa-head { font-weight: 700; margin-bottom: 4px; }
.wa-bubble .wa-media { background: #cfd8dc; border-radius: 7px; height: 130px; display: grid; place-items: center; color: #607d8b; margin: -2px -4px 6px; }
.wa-bubble .wa-foot { color: #8a8a8a; font-size: 12px; margin-top: 4px; }
.wa-bubble .wa-time { text-align: right; font-size: 10.5px; color: #8a8a8a; }
.wa-btns { max-width: 320px; margin-top: 3px; display: grid; gap: 3px; }
.wa-btns div { background: #fff; border-radius: 8px; text-align: center; padding: 8px; color: #027eb5; font-weight: 600; font-size: 13px; box-shadow: 0 1px 1px rgba(0,0,0,.1); }

/* ------------------------------------------------------------------ inbox */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; height: calc(100vh - 62px); background: var(--surface); }
.inbox.no-side { grid-template-columns: 330px minmax(0, 1fr); }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: 14px; border-bottom: 1px solid var(--border); }
.inbox-items { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none !important; color: inherit; position: relative; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--brand-50); }
.conv .name { font-weight: 700; font-size: 13.5px; }
.conv .preview { color: var(--text-2); font-size: 12.5px; }
.conv .time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.conv .unread { background: #25d366; color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px 6%; background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23ddd5cb'/%3E%3C/svg%3E"); display: flex; flex-direction: column; gap: 6px; }
[data-theme="dark"] .chat-body { background: #0b141a; }
.msg { max-width: 68%; padding: 7px 10px 5px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 1px .5px rgba(0,0,0,.13); word-break: break-word; position: relative; color: #111b21; }
.msg-text { white-space: pre-wrap; }
.msg.in { background: #fff; align-self: flex-start; border-top-left-radius: 2px; }
.msg.out { background: #d9fdd3; align-self: flex-end; border-top-right-radius: 2px; }
[data-theme="dark"] .msg.in { background: #202c33; color: #e9edef; }
[data-theme="dark"] .msg.out { background: #005c4b; color: #e9edef; }
.msg.note { background: #fff6d6; align-self: center; font-size: 12.5px; color: #775f00; max-width: 80%; }
.msg .meta { display: flex; gap: 5px; justify-content: flex-end; align-items: center; font-size: 10.5px; color: #667781; margin-top: 2px; }
.msg .meta .ic { width: 14px; height: 14px; }
.msg .meta .read { color: #53bdeb; }
.msg img, .msg video { border-radius: 7px; max-height: 260px; margin-bottom: 4px; }
.msg .src { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: .55; }
.msg .btns { margin-top: 6px; display: grid; gap: 4px; }
.msg .btns span { display: block; text-align: center; border-top: 1px solid rgba(0,0,0,.08); padding-top: 5px; color: #027eb5; font-weight: 600; }
.day-sep { align-self: center; background: rgba(255,255,255,.9); color: #54656f; font-size: 11.5px; padding: 3px 10px; border-radius: 7px; margin: 6px 0; box-shadow: 0 1px .5px rgba(0,0,0,.1); }
.composer { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--surface); }
.composer textarea { border: 1px solid var(--border-2); border-radius: 11px; width: 100%; resize: none; padding: 10px 12px; font: 14px/1.4 var(--font); min-height: 44px; max-height: 160px; background: var(--surface); color: var(--text); outline: none; }
.composer textarea:focus { border-color: var(--brand); }
.composer-tools { display: flex; gap: 4px; align-items: center; margin-top: 8px; }
.window-warn { padding: 10px 14px; background: var(--amber-50); color: var(--amber); font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--border); }
.contact-side { border-left: 1px solid var(--border); overflow-y: auto; padding: 18px; }
.ai-suggestions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ai-suggestion { text-align: left; background: var(--purple-50); border: 1px solid rgba(124,58,237,.2); color: var(--text); border-radius: 9px; padding: 8px 10px; font: 13px/1.4 var(--font); cursor: pointer; }
.ai-suggestion:hover { border-color: var(--purple); }

/* ------------------------------------------------------------------ kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; }
.kanban-col { background: var(--gray-50); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kanban-col h4 { display: flex; justify-content: space-between; align-items: center; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 2px 4px 12px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); cursor: grab; }
.kanban-card.dragging { opacity: .5; }
.kanban-col.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
.prio-high { border-left: 3px solid var(--red); } .prio-medium { border-left: 3px solid var(--amber); } .prio-low { border-left: 3px solid var(--blue); }

/* ----------------------------------------------------------- flow builder */
.builder { display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; height: calc(100vh - 62px); }
.builder-palette { border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 12px; }
.builder-palette h5 { text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; color: var(--text-3); margin: 14px 4px 8px; }
.palette-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; cursor: grab; background: var(--surface); font-weight: 600; font-size: 13px; user-select: none; }
.palette-item:hover { border-color: var(--brand); background: var(--brand-50); }
.palette-item .pi { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.palette-item .pi .ic { width: 15px; height: 15px; }
.builder-canvas { position: relative; background: var(--surface-2); background-image: radial-gradient(var(--border-2) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }
#drawflow { width: 100%; height: 100%; }
.builder-props { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 16px; }
.builder-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; z-index: 5; pointer-events: none; }
.builder-toolbar > * { pointer-events: auto; }
.drawflow .drawflow-node { background: var(--surface) !important; border: 1.5px solid var(--border-2) !important; border-radius: 12px !important; padding: 0 !important; width: 230px !important; box-shadow: var(--shadow) !important; color: var(--text) !important; min-height: 0 !important; }
.drawflow .drawflow-node.selected { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(247,165,28,.25), var(--shadow) !important; }
.drawflow .drawflow-node .input, .drawflow .drawflow-node .output { width: 14px !important; height: 14px !important; border: 2px solid var(--surface) !important; background: var(--text-3) !important; padding: 0 !important; }
.drawflow .drawflow-node .output { background: var(--brand) !important; }
.drawflow .connection .main-path { stroke: var(--brand) !important; stroke-width: 2.5px !important; }
.drawflow .drawflow-delete { background: var(--red) !important; border: 2px solid #fff !important; line-height: 26px !important; }
.drawflow-node .df-head { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 12.5px; border-radius: 11px 11px 0 0; }
.drawflow-node .df-head .ic { width: 15px; height: 15px; }
.drawflow-node .df-body { padding: 9px 12px; font-size: 12px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 92px; overflow: hidden; }
.drawflow-node .df-outs { padding: 0 12px 8px; font-size: 11px; color: var(--text-3); }
.drawflow-node .df-outs div { text-align: right; height: 22px; line-height: 22px; }
.drawflow .drawflow-node .outputs { display: flex; flex-direction: column; justify-content: flex-end; }

/* ------------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 10% 10%, #3a2a0a 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #2b1d03 0%, transparent 55%), var(--ink); color: #dbe6f5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; max-width: 460px; }
.auth-side .points { display: grid; gap: 14px; margin-top: 26px; max-width: 420px; }
.auth-side .point { display: flex; gap: 12px; align-items: flex-start; }
.auth-side .point .stat-icon { background: rgba(247,165,28,.22); color: #fcc96b; width: 36px; height: 36px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 26px; }
.oauth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 18px 0; }
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------------------------------------------------------------- landing */
.lp { background: #fff; color: #0f172a; }
.lp-nav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(15,23,42,.06); }
.lp-nav .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.lp-nav .links { display: flex; gap: 24px; margin-left: 12px; }
.lp-nav .links a { color: #334155; font-weight: 600; font-size: 14px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.lp-hero { padding: 84px 0 70px; background: radial-gradient(900px 420px at 50% -10%, #ffe9bf 0%, transparent 70%); text-align: center; }
.lp-hero h1 { font-size: 54px; letter-spacing: -.035em; line-height: 1.06; max-width: 860px; margin: 18px auto 18px; }
.lp-hero h1 em { font-style: normal; background: linear-gradient(90deg, #e08d00, #f7a51c 45%, #111 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p.lead { font-size: 18px; color: #475569; max-width: 640px; margin: 0 auto 30px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 99px; background: #fff; border: 1px solid #ffe2a8; color: #a86800; font-weight: 700; font-size: 13px; box-shadow: 0 2px 10px rgba(247,165,28,.15); }
.lp-shot { margin: 54px auto 0; max-width: 1040px; border-radius: 18px; border: 1px solid #e2e8f0; box-shadow: 0 40px 90px rgba(15,23,42,.18); overflow: hidden; background: #0e0e10; }
.lp-section { padding: 84px 0; }
.lp-section.alt { background: #f8fafc; }
.lp-section.dark { background: #0e0e10; color: #cbd5e1; }
.lp-section.dark h2 { color: #fff; }
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.sec-head h2 { font-size: 38px; letter-spacing: -.025em; }
.sec-head p { color: #64748b; font-size: 17px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 26px; transition: transform .2s, box-shadow .2s; }
.feat:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,.08); }
.feat .stat-icon { margin-bottom: 16px; }
.feat h3 { font-size: 18px; }
.feat p { color: #64748b; margin-bottom: 12px; }
.feat .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.feat .tags span { font-size: 12px; font-weight: 600; background: #f1f5f9; color: #334155; padding: 3px 9px; border-radius: 6px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: stretch; }
.price { border: 1px solid #e2e8f0; border-radius: 18px; padding: 28px; background: #fff; display: flex; flex-direction: column; }
.price.featured { border: 2px solid var(--brand); box-shadow: 0 24px 60px rgba(247,165,28,.2); position: relative; }
.price.featured::before { content: "Most popular"; position: absolute; top: -12px; left: 28px; background: var(--brand); color: #111; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.price .amount { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.price .per { color: #64748b; font-weight: 600; }
.price .feature-list { margin: 20px 0 24px; flex: 1; }
.faq details { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; background: #fff; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--brand); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: #475569; }
.lp-cta { background: linear-gradient(135deg, #3a2a0a, #0e0e10); color: #fff; border-radius: 24px; padding: 56px; text-align: center; }
.lp-cta h2 { color: #fff; font-size: 34px; }
.lp-foot { background: #0e0e10; color: #94a3b8; padding: 48px 0 28px; }
.lp-foot .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 36px; }
.lp-foot h5 { color: #fff; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.lp-foot a { color: #94a3b8; display: block; padding: 3px 0; }
.lp-foot .bottom { border-top: 1px solid #1e293b; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.lp-foot .sg-credit { color: #f7a51c; }
.mock-ui { display: grid; grid-template-columns: 200px 1fr; min-height: 420px; text-align: left; }
.mock-side { background: #0e0e10; padding: 18px 12px; }
.mock-side div { height: 30px; border-radius: 8px; margin-bottom: 8px; background: #1d1d22; }
.mock-side div.on { background: rgba(247,165,28,.35); }
.mock-main { background: #f5f7fb; padding: 22px; display: grid; gap: 16px; grid-template-rows: auto 1fr; }
.mock-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mock-stats div { background: #fff; border-radius: 12px; height: 82px; border: 1px solid #e5e9f2; padding: 14px; }
.mock-stats b { display: block; font-size: 22px; color: #0f172a; }
.mock-stats small { color: #64748b; font-weight: 600; }
.mock-chart { background: #fff; border-radius: 12px; border: 1px solid #e5e9f2; padding: 18px; display: flex; align-items: flex-end; gap: 10px; }
.mock-chart span { flex: 1; background: linear-gradient(180deg, #ffc65c, #f7a51c); border-radius: 6px 6px 0 0; }

/* ----------------------------------------------------------------- widget */
.code-box { position: relative; }
.code-box .btn { position: absolute; top: 8px; right: 8px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox .contact-side { display: none; }
  .builder { grid-template-columns: 210px minmax(0, 1fr) 300px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .g-3, .g-side, .g-side-l, .g-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .lp-hero h1 { font-size: 38px; }
  .lp-nav .links { display: none; }
  .lp-foot .cols { grid-template-columns: 1fr 1fr; }
  .mock-ui { grid-template-columns: 1fr; } .mock-side { display: none; }
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-active .inbox-list { display: none; }
  .inbox:not(.has-active) .chat { display: none; }
  .builder { grid-template-columns: 1fr; grid-template-rows: auto 60vh auto; height: auto; }
  .kanban { grid-template-columns: repeat(3, 260px); }
}
@media (max-width: 640px) {
  .page { padding: 16px; }
  .topbar { padding: 0 14px; }
  .g-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .mock-stats { grid-template-columns: 1fr 1fr; }
  .lp-cta { padding: 32px 20px; }
  .msg { max-width: 88%; }
}
[data-theme="dark"] a, [data-theme="dark"] .text-brand, [data-theme="dark"] .sg-credit, [data-theme="dark"] .link-btn, [data-theme="dark"] .tab.active { color: #fbbf4d; }
.grid > .card + .card { margin-top: 0; }
label.switch { display: flex; width: fit-content; }

/* ------------------------------------------------------- SG flow builder */
.fb-canvas { position: relative; overflow: hidden; background-color: var(--surface-2); background-image: radial-gradient(var(--border-2) 1px, transparent 1px); background-size: 22px 22px; cursor: grab; touch-action: none; user-select: none; }
.fb-canvas.panning { cursor: grabbing; }
.fb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 1px; height: 1px; }
.fb-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.fb-svg path.fb-line { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.fb-svg path.fb-line.selected { stroke: var(--red); stroke-width: 3; }
.fb-svg path.fb-line.temp { stroke-dasharray: 6 5; }
.fb-svg path.fb-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.fb-svg .fb-cdel { pointer-events: all; cursor: pointer; }
.fb-svg .fb-cdel circle { fill: var(--red); stroke: #fff; stroke-width: 2; }
.fb-svg .fb-cdel text { fill: #fff; font: 700 14px var(--font); }
.fb-node { position: absolute; width: 240px; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); cursor: default; }
.fb-node.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(247,165,28,.25), var(--shadow); }
.fb-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 12.5px; border-radius: 11px 11px 0 0; cursor: move; }
.fb-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.fb-ic svg { width: 14px; height: 14px; }
.fb-title { flex: 1; }
.fb-del { border: 0; background: none; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.fb-del:hover { color: var(--red); }
.fb-body { padding: 9px 12px; font-size: 12px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 96px; overflow: hidden; cursor: move; }
.fb-outs { padding: 0 0 6px; }
.fb-out { display: flex; justify-content: flex-end; align-items: center; gap: 6px; height: 24px; font-size: 11px; color: var(--text-3); padding-left: 12px; }
.fb-out span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.fb-port { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); display: inline-block; cursor: crosshair; flex-shrink: 0; }
.fb-o { background: var(--brand); margin-right: -8px; }
.fb-o:hover { transform: scale(1.25); }
.fb-in { position: absolute; left: -8px; top: 14px; background: var(--text-3); }
.fb-in.hover { background: var(--brand); transform: scale(1.35); }
.fb-c-brand .fb-ic { background: var(--brand-50); color: var(--brand-700); }
.fb-c-green .fb-ic { background: var(--green-50); color: var(--green); }
.fb-c-blue .fb-ic { background: var(--blue-50); color: var(--blue); }
.fb-c-amber .fb-ic { background: var(--amber-50); color: var(--amber); }
.fb-c-purple .fb-ic { background: var(--purple-50); color: var(--purple); }
.fb-c-teal .fb-ic { background: var(--teal-50); color: var(--teal); }
.fb-c-red .fb-ic { background: var(--red-50); color: var(--red); }
.fb-c-brand .fb-head { background: linear-gradient(90deg, var(--brand-50), transparent); }
.fb-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 5; pointer-events: none; flex-wrap: wrap; }
.fb-toolbar > * { pointer-events: auto; }
.fb-zoombar { position: absolute; bottom: 14px; left: 14px; display: flex; gap: 4px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: var(--shadow-sm); z-index: 5; }
.fb-zoom { font-size: 12px; font-weight: 700; min-width: 44px; text-align: center; color: var(--text-2); }
