/* ==========================================================================
   NexaCRM — design system
   Tokens → base → layout → components → utilities. No build step required.
   ========================================================================== */

:root {
  --brand-50: #eef3ff; --brand-100: #dbe5ff; --brand-200: #b9caff; --brand-500: #4263eb; --brand-600: #3651d4; --brand-700: #2b41ad;
  --clay-500: #c2562b; --clay-50: #fdf2ec;

  --gray-0: #ffffff; --gray-25: #fbfcfd; --gray-50: #f6f7f9; --gray-100: #eef0f3; --gray-200: #e2e5ea; --gray-300: #cdd2da;
  --gray-400: #9aa3b1; --gray-500: #6b7484; --gray-600: #4f5768; --gray-700: #363c4a; --gray-800: #232733; --gray-900: #151821;

  --green-50: #ecfdf3; --green-600: #15803d; --green-700: #166534;
  --red-50: #fef2f2; --red-600: #dc2626; --red-700: #b91c1c;
  --amber-50: #fffbeb; --amber-600: #d97706; --amber-700: #b45309;
  --blue-50: #eff6ff; --blue-600: #2563eb;
  --sky-50: #f0f9ff; --sky-600: #0284c7;
  --indigo-50: #eef2ff; --indigo-600: #4f46e5;
  --violet-50: #f5f3ff; --violet-600: #7c3aed;
  --purple-50: #faf5ff; --purple-600: #9333ea;

  --bg: var(--gray-50);
  --surface: var(--gray-0);
  --surface-muted: var(--gray-25);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
  --text-subtle: var(--gray-400);
  --primary: var(--brand-500);
  --primary-hover: var(--brand-600);
  --focus: 0 0 0 3px rgba(66, 99, 235, .25);

  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);

  --sidebar-w: 248px;
  --topbar-h: 60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gujarati", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Sans Gurmukhi", "Noto Sans Oriya", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::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.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--gray-900); font-weight: 600; line-height: 1.25; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 .75em; }
small, .small { font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
img, svg { vertical-align: middle; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--gray-900) var(--sidebar-w), transparent var(--sidebar-w)); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--gray-900); color: var(--gray-300); display: flex; flex-direction: column; z-index: 40; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px; color: #fff; font-weight: 700; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar__brand:hover { text-decoration: none; color: #fff; }
img.brand-mark { background: none; object-fit: contain; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #8b5cf6); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.02em; }
.sidebar__tenant { padding: 12px 18px; font-size: 12px; color: var(--gray-400); border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar__tenant strong { display: block; color: var(--gray-100); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav { padding: 10px 10px 24px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group__label { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--gray-300); font-weight: 500; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.is-active { background: rgba(66,99,235,.22); color: #fff; }
.nav-link.is-active .icon { color: var(--brand-200); }
.sidebar__footer { padding: 12px 18px; font-size: 11px; color: var(--gray-500); border-top: 1px solid rgba(255,255,255,.06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border); }
.topbar .topbar__menu { display: none; }
.topbar__search { flex: 1; max-width: 520px; position: relative; }
.topbar__search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); }
.topbar__search input { padding-left: 36px; background: var(--gray-50); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-header__title p { margin: 4px 0 0; color: var(--text-muted); }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumbs a { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn { --btn-bg: var(--surface); --btn-fg: var(--gray-700); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s; }
.btn:hover { text-decoration: none; background: var(--gray-50); color: var(--gray-900); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-bd: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--red-600); --btn-bd: #f3c4c4; }
.btn-danger:hover { background: var(--red-50); color: var(--red-700); }
.btn-danger-solid { --btn-bg: var(--red-600); --btn-fg: #fff; --btn-bd: var(--red-600); }
.btn-danger-solid:hover { background: var(--red-700); color: #fff; }
.btn-success { --btn-bg: var(--green-600); --btn-fg: #fff; --btn-bd: var(--green-600); }
.btn-success:hover { background: var(--green-700); color: #fff; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.is-active { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); z-index: 1; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--gray-600); cursor: pointer; }
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.dot-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red-600); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 20px; }
.form-field { grid-column: span 6; min-width: 0; }
.form-field.w-half { grid-column: span 3; }
.form-field.w-third { grid-column: span 2; }
.form-field.w-two-thirds { grid-column: span 4; }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--gray-700); }
.label .req { color: var(--red-600); margin-left: 2px; }
.input, .select, .textarea { display: block; width: 100%; height: 38px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; min-height: 92px; padding: 9px 12px; resize: vertical; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7484' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input[readonly] { background: var(--gray-50); color: var(--text-muted); }
.input-sm, .select-sm { height: 32px; font-size: 13px; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--red-600); }
.field-error { margin-top: 5px; font-size: 12px; color: var(--red-600); }
.field-help { margin-top: 5px; font-size: 12px; color: var(--text-muted); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; height: 38px; }
.form-section { padding: 20px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > .form-grid { clear: both; }
.form-section__title { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--gray-900); text-transform: uppercase; letter-spacing: .04em; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Typeahead / combobox */
.combo { position: relative; }
.combo__list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; display: none; }
.combo.is-open .combo__list { display: block; }
.combo__item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: var(--text); }
.combo__item small { display: block; color: var(--text-muted); }
.combo__item:hover, .combo__item.is-active { background: var(--brand-50); }
.combo__empty { padding: 10px; color: var(--text-muted); font-size: 13px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card__header h2 { font-size: 14px; }
.card__header .muted { font-size: 12px; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-muted); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--brand-200); box-shadow: var(--shadow); }
.stat__label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat__value { font-size: 24px; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__meta { font-size: 12px; color: var(--text-muted); }
.stat--alert .stat__value { color: var(--red-600); }
.stat--good .stat__value { color: var(--green-600); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { position: sticky; top: 0; background: var(--surface-muted); text-align: left; font-weight: 600; font-size: 12px; color: var(--gray-600); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tbody tr:hover td { background: var(--gray-25); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-check { width: 40px; padding-right: 0; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-title { font-weight: 600; color: var(--gray-900); }
.table-title:hover { color: var(--primary); }
.table-sub { display: block; font-size: 12px; color: var(--text-muted); }
.table--compact td, .table--compact th { padding: 8px 12px; }
.table tfoot td { font-weight: 600; background: var(--surface-muted); border-top: 1px solid var(--border); }

/* Toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; height: 34px; font-size: 13px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 340px; }
.toolbar__spacer { flex: 1; }
.bulk-bar { display: none; align-items: center; gap: 8px; padding: 10px 14px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 13px; }
.bulk-bar.is-visible { display: flex; flex-wrap: wrap; }
.bulk-bar .select { width: auto; height: 30px; font-size: 13px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.pagination__pages { display: flex; gap: 4px; }
.page-link { min-width: 32px; height: 32px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--gray-700); background: var(--surface); }
.page-link:hover { text-decoration: none; background: var(--gray-50); }
.page-link.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--gray-100); color: var(--gray-700); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge--plain::before { display: none; }
.badge--blue { background: var(--blue-50); color: var(--blue-600); }
.badge--sky { background: var(--sky-50); color: var(--sky-600); }
.badge--indigo { background: var(--indigo-50); color: var(--indigo-600); }
.badge--violet { background: var(--violet-50); color: var(--violet-600); }
.badge--purple { background: var(--purple-50); color: var(--purple-600); }
.badge--green { background: var(--green-50); color: var(--green-700); }
.badge--red { background: var(--red-50); color: var(--red-700); }
.badge--amber { background: var(--amber-50); color: var(--amber-700); }
.badge--gray { background: var(--gray-100); color: var(--gray-600); }
.priority { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; }
.priority::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.priority--low::before { background: var(--gray-400); }
.priority--medium::before { background: var(--sky-600); }
.priority--high::before { background: var(--amber-600); }
.priority--urgent::before { background: var(--red-600); }
.text-overdue { color: var(--red-600); font-weight: 600; }
.text-today { color: var(--amber-700); font-weight: 600; }

/* Avatar */
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--gray-700); font: inherit; text-align: left; cursor: pointer; }
.dropdown__item:hover { background: var(--gray-50); color: var(--gray-900); text-decoration: none; }
.dropdown__item--danger { color: var(--red-600); }
.dropdown__header { padding: 8px 10px; font-size: 12px; color: var(--text-muted); }
.dropdown__divider { height: 1px; background: var(--border); margin: 6px 0; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; }
.notif-menu__list { max-height: 380px; overflow-y: auto; }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--gray-100); color: var(--text); }
.notif-item:hover { background: var(--gray-50); text-decoration: none; }
.notif-item.is-unread { background: var(--brand-50); }
.notif-item small { display: block; color: var(--text-muted); }

/* ---------- Modal / drawer ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; background: rgba(21, 24, 33, .45); }
.modal.is-open { display: flex; }
.modal__dialog { width: 100%; max-width: 520px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 84vh; display: flex; flex-direction: column; }
.modal__dialog--lg { max-width: 760px; }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(21, 24, 33, .4); }
.drawer.is-open { display: block; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; max-width: 460px; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 12px 14px; background: var(--gray-900); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .18s ease-out; }
.toast--success .icon { color: #4ade80; }
.toast--error { background: var(--red-700); }
.toast__close { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 0; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert { padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert--error { background: var(--red-50); border-color: #f5c2c2; color: var(--red-700); }
.alert--warning { background: var(--amber-50); border-color: #f6dca6; color: var(--amber-700); }
.alert--info { background: var(--blue-50); border-color: #c7dbfe; color: #1e40af; }
.alert--success { background: var(--green-50); border-color: #b7ebc8; color: var(--green-700); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--gray-600); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font: inherit; }
.tab:hover { color: var(--gray-900); text-decoration: none; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); font-size: 11px; display: inline-grid; place-items: center; }
.tab.is-active .count { background: var(--brand-100); color: var(--brand-700); }
.tab .count--alert { background: var(--red-50); color: var(--red-700); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Empty / loading / error states ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--text-muted); }
.empty__icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; background: var(--gray-100); display: grid; place-items: center; color: var(--gray-500); }
.empty h3 { color: var(--gray-800); margin-bottom: 4px; }
.empty p { margin-bottom: 14px; }
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 37%, var(--gray-100) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); height: 14px; }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Detail pages ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; color: var(--gray-900); word-break: break-word; }
.dl--stack { grid-template-columns: 1fr; gap: 2px; }
.dl--stack dd { margin-bottom: 10px; }
.record-head { display: flex; gap: 14px; align-items: center; }
.record-head .avatar { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; color: var(--text-muted); font-size: 13px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.stage-track { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.stage-track form { flex: 1; min-width: 92px; }
.stage-step { width: 100%; height: 34px; border: 0; background: var(--gray-100); color: var(--gray-600); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); padding: 0 14px; white-space: nowrap; }
.stage-track form:first-child .stage-step { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.stage-step:hover { background: var(--gray-200); }
.stage-step.is-done { background: var(--brand-100); color: var(--brand-700); }
.stage-step.is-current { background: var(--primary); color: #fff; }
.stage-step.is-won { background: var(--green-600); color: #fff; }
.stage-step.is-lost { background: var(--red-600); color: #fff; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; display: flex; gap: 12px; padding: 0 0 18px; }
.timeline__item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--gray-100); }
.timeline__item:last-child::before { display: none; }
.timeline__icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-100); color: var(--gray-600); flex: none; }
.timeline__icon--call { background: var(--green-50); color: var(--green-700); }
.timeline__icon--meeting { background: var(--violet-50); color: var(--violet-600); }
.timeline__icon--email { background: var(--blue-50); color: var(--blue-600); }
.timeline__icon--whatsapp { background: #e7f8ee; color: #128c4b; }
.timeline__icon--note { background: var(--amber-50); color: var(--amber-700); }
.timeline__icon--status_change { background: var(--indigo-50); color: var(--indigo-600); }
.timeline__body { flex: 1; min-width: 0; }
.timeline__title { font-weight: 500; color: var(--gray-900); }
.timeline__meta { font-size: 12px; color: var(--text-muted); }
.timeline__text { margin-top: 6px; padding: 10px 12px; background: var(--gray-50); border-radius: var(--radius); white-space: pre-wrap; word-break: break-word; font-size: 13px; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kanban__col { background: var(--gray-100); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.kanban__head { padding: 12px 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.kanban__head .swatch { width: 10px; height: 10px; border-radius: 3px; }
.kanban__head .total { margin-left: auto; font-weight: 500; color: var(--text-muted); font-size: 12px; }
.kanban__list { padding: 0 10px 10px; overflow-y: auto; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.kanban__list.is-over { background: var(--brand-50); border-radius: var(--radius); }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: .5; }
.kanban-card__title { font-weight: 600; color: var(--gray-900); display: block; margin-bottom: 4px; }
.kanban-card__meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); gap: 6px; }

/* Charts (CSS/SVG, no library) */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-list__row { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.bar-list__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--gray-700); }
.bar-list__track { height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.bar-list__fill { height: 100%; background: var(--primary); border-radius: 99px; }
.bar-list__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--gray-900); font-weight: 500; }
.col-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.col-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.col-chart__bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.col-chart__label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.col-chart__value { font-size: 11px; color: var(--gray-700); font-weight: 600; white-space: nowrap; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel__row { display: grid; grid-template-columns: 110px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; }
.funnel__bar { height: 26px; border-radius: 6px; min-width: 4px; display: flex; align-items: center; padding-left: 8px; color: #fff; font-size: 12px; font-weight: 600; }

/* Line items editor */
.items-table .input, .items-table .select { height: 34px; font-size: 13px; }
.items-table td { padding: 6px 6px; vertical-align: top; }
.items-table .col-desc { min-width: 260px; }
.items-table .col-qty, .items-table .col-price { width: 110px; }
.items-table .col-small { width: 92px; }
.items-table .col-total { width: 130px; text-align: right; padding-top: 14px; font-variant-numeric: tabular-nums; }
.totals { margin-left: auto; width: 100%; max-width: 360px; font-size: 13.5px; }
.totals__row { display: flex; justify-content: space-between; padding: 6px 0; gap: 12px; }
.totals__row--grand { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 700; color: var(--gray-900); }
.totals .input { width: 130px; height: 32px; text-align: right; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth__aside { background: radial-gradient(1200px 600px at 10% 10%, #2a3350, var(--gray-900)); color: var(--gray-300); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 42px 42px; transform: rotate(12deg); }
.auth__aside h2 { color: #fff; font-size: 28px; line-height: 1.25; max-width: 440px; letter-spacing: -.02em; }
.auth__aside ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.auth__aside li { display: flex; gap: 10px; align-items: center; }
.auth__main { display: grid; place-items: center; padding: 32px; }
.auth__card { width: 100%; max-width: 380px; }
.auth__card h1 { margin-bottom: 6px; }

/* ---------- Print (quotations) ---------- */
.doc { background: #fff; max-width: 880px; margin: 0 auto; padding: 40px; color: #111; font-size: 13px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th, .doc td { border: 1px solid #d5d9e0; padding: 7px 9px; text-align: left; vertical-align: top; }
.doc th { background: #f3f5f8; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.doc .num { text-align: right; }
.doc__head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 3px solid var(--clay-500); padding-bottom: 16px; margin-bottom: 20px; }
.doc__title { font-size: 26px; font-weight: 800; color: var(--clay-500); letter-spacing: .04em; }
.doc__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; }
.doc__box h4 { font-size: 11px; text-transform: uppercase; color: #6b7280; margin-bottom: 6px; letter-spacing: .05em; }
.doc__terms { white-space: pre-wrap; font-size: 12px; color: #374151; }
.doc-toolbar { max-width: 880px; margin: 16px auto; display: flex; gap: 8px; justify-content: flex-end; padding: 0 16px; }
@media print {
  body { background: #fff; }
  .doc-toolbar, .sidebar, .topbar, .no-print { display: none !important; }
  .doc { padding: 0; max-width: none; }
  @page { margin: 14mm; }
}

/* ---------- Utilities ---------- */
.border-top { border-top: 1px solid var(--border); }
.p-2 { padding: 10px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.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; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.p-0 { padding: 0; }
.muted { color: var(--text-muted); } .subtle { color: var(--text-subtle); }
.text-right { text-align: right; } .text-center { text-align: center; }
.text-green { color: var(--green-600); } .text-red { color: var(--red-600); } .text-amber { color: var(--amber-700); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.tabular { font-variant-numeric: tabular-nums; }
.inline { display: inline; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.list-row:last-child { border-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .grid-dash { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open::after { content: ""; position: fixed; inset: 0; background: rgba(21,24,33,.4); z-index: 35; }
  .topbar .topbar__menu { display: inline-grid; }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
  .form-field.w-half, .form-field.w-third, .form-field.w-two-thirds { grid-column: span 6; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 19px; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .dl { grid-template-columns: 110px 1fr; }
  .bar-list__row { grid-template-columns: 90px 1fr 60px; }
  .hide-sm { display: none !important; }
  .table td, .table th { padding: 9px 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat__value { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- SaaS control plane ---------- */
.banner { display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 13px; border-bottom: 1px solid; flex-wrap: wrap; }
.banner form { margin: 0; }
.banner__spacer { flex: 1; }
.banner--impersonation { background: #3b0764; border-color: #581c87; color: #f3e8ff; }
.banner--impersonation strong { color: #fff; }
.banner--warning { background: var(--amber-50); border-color: #f6dca6; color: var(--amber-700); }
.banner--critical, .banner--error { background: var(--red-50); border-color: #f5c2c2; color: var(--red-700); }
.banner--info, .banner--maintenance { background: var(--blue-50); border-color: #c7dbfe; color: #1e40af; }
.banner--success { background: var(--green-50); border-color: #b7ebc8; color: var(--green-700); }
.meter { height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; min-width: 80px; }
.meter__fill { height: 100%; background: var(--primary); border-radius: 99px; }
.meter__fill--warn { background: var(--amber-600); }
.meter__fill--over { background: var(--red-600); }
.app--admin { background: linear-gradient(90deg, #0b1020 var(--sidebar-w), transparent var(--sidebar-w)); }
.sidebar--admin { background: #0b1020; }
.sidebar--admin .brand-mark { background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.admin-pill { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--clay-500); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.matrix .input { width: 96px; height: 30px; text-align: right; }
.source { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--gray-100); color: var(--gray-600); }
.source--override { background: var(--violet-50); color: var(--violet-600); }
.source--addon, .source--plan\+addon { background: var(--sky-50); color: var(--sky-600); }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: center; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); margin-right: 6px; }
.status-dot--ok { background: var(--green-600); } .status-dot--warning { background: var(--amber-600); } .status-dot--failed { background: var(--red-600); }
.danger-zone { border-color: #f5c2c2; }
.danger-zone .card__header { background: var(--red-50); }

/* ---------- Public web form (/f/{key}) ---------- */
.pf-body { background: var(--bg); min-height: 100vh; margin: 0; display: flex; justify-content: center; padding: 24px 16px; }
.pf-body.is-embedded { background: transparent; padding: 0; }
.pf { width: 100%; max-width: 560px; }
.pf .card__body { padding: 24px; }
.pf h1 { font-size: 20px; margin: 0 0 6px; }
.pf-intro { color: var(--text-muted); margin: 0 0 18px; white-space: pre-line; }
.pf-field { margin-bottom: 14px; }
.pf-field .label { display: block; margin-bottom: 4px; }
.pf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pf-foot { margin-top: 14px; font-size: 12px; color: var(--text-muted); text-align: center; }
.pf-done { text-align: center; padding: 24px 8px; }
.pf-done .icon { width: 40px; height: 40px; color: var(--green-600); }

/* ---------- Workflow builder ---------- */
.wf-steps { list-style: none; margin: 0; padding: 0; counter-reset: wfstep; }
.wf-step { position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 14px 14px 10px 52px; margin: 0 0 22px; }
.wf-step::before { counter-increment: wfstep; content: counter(wfstep); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wf-step::after { content: ''; position: absolute; left: 26px; bottom: -22px; width: 2px; height: 22px; background: var(--border); }
.wf-step:last-child::after { display: none; }
.wf-step[data-type="wait"] { border-style: dashed; }
.wf-step[data-type="condition"] { border-color: var(--amber-600); }
.wf-step__head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.wf-step__head .wf-type { font-weight: 600; font-size: 13px; }
.wf-step__head .wf-tools { margin-left: auto; display: flex; gap: 4px; }
.wf-step .form-grid { margin-bottom: 4px; }
.wf-trigger { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 22px; position: relative; }
.wf-trigger::after { content: ''; position: absolute; left: 26px; bottom: -22px; width: 2px; height: 22px; background: var(--border); }
.wf-add { display: flex; gap: 8px; flex-wrap: wrap; }
.funnel-bar { height: 10px; border-radius: 5px; background: var(--primary); opacity: .85; min-width: 2px; }
.wf-step [hidden] { display: none !important; }
.lf-fields { display: grid; gap: 6px; clear: both; width: 100%; }
.lf-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 2fr); gap: 12px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); }
.lf-row.lf-head { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 640px) { .lf-row { grid-template-columns: 1fr 1fr; } .lf-row .input { grid-column: span 2; } .lf-head { display: none; } }

/* ---------- Public website ---------- */
.site { background: var(--surface); }
.site-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.site-narrow { max-width: 760px; }
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.site-header__in { display: flex; align-items: center; gap: 24px; height: 64px; }
.site-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.site-brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 20px; flex: 1; }
.site-nav a { color: var(--text-muted); font-weight: 500; }
.site-nav a[aria-current] { color: var(--primary); }
.site-cta { display: flex; gap: 8px; }
.site-hero { padding: 72px 0 56px; background: linear-gradient(180deg, var(--brand-50), var(--surface)); text-align: center; }
.site-hero--sm { padding: 48px 0 32px; }
.site-hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; margin: 0 auto 16px; max-width: 820px; }
.site-lead { font-size: 18px; color: var(--text-muted); max-width: 720px; margin: 0 auto 24px; }
.site-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.site-section { padding: 48px 0; }
.site-section--alt { background: var(--surface-muted); }
.site-grid-1, .site-grid-2, .site-grid-3, .site-grid-4 { display: grid; gap: 20px; }
.site-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.site-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.site-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.site-card > .icon { width: 28px; height: 28px; color: var(--primary); }
.site-card h3 { margin: 10px 0 6px; font-size: 18px; }
.site-plan { display: flex; flex-direction: column; }
.site-price { font-size: 28px; font-weight: 700; margin: 8px 0; }
.site-list { list-style: none; padding: 0; margin: 8px 0 0; }
.site-list li { display: flex; gap: 6px; align-items: flex-start; padding: 3px 0; font-size: 14px; }
.site-list .icon { color: var(--green-600); flex: none; margin-top: 2px; }
.site-toggle { display: inline-flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 4px; background: var(--surface); }
.site-toggle a, .site-toggle label { padding: 6px 14px; border-radius: 999px; color: var(--text-muted); cursor: pointer; font-size: 14px; }
.site-toggle .is-active { background: var(--primary); color: #fff; }
.site-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.site-faq { border-bottom: 1px solid var(--border); padding: 14px 0; }
.site-faq summary { font-weight: 600; cursor: pointer; }
.site-prose p { line-height: 1.7; }
.site-checkout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.site-summary { position: sticky; top: 84px; }
.site-sum { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 12px 0; }
.site-sum dd { margin: 0; text-align: right; }
.site-sum__total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--border); padding-top: 8px; }
.site-method { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: pointer; }
.site-upi { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.site-upi img { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; background: var(--surface-muted); }
.site-footer__in { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1fr; gap: 20px; }
.site-footer nav { display: flex; flex-direction: column; gap: 6px; }
.h3 { font-size: 18px; margin: 0 0 12px; }
@media (max-width: 900px) {
  .site-grid-3, .site-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-checkout { grid-template-columns: 1fr; }
  .site-summary { position: static; }
  .site-header__in { flex-wrap: wrap; height: auto; padding: 10px 20px; gap: 8px 16px; }
  .site-brand { flex: 1; }
  .site-nav { order: 3; flex: 0 0 100%; overflow-x: auto; gap: 14px; white-space: nowrap; scrollbar-width: none; padding-bottom: 4px; font-size: 14px; }
}
@media (max-width: 600px) {
  .site-grid-2, .site-grid-3, .site-grid-4, .site-footer__in { grid-template-columns: 1fr; }
  .site-cta .btn-ghost { display: none; }
}

/* ---------- Animated homepage ---------- */
.site-header { background: rgba(255,255,255,.78); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); }
.hx-hero { position: relative; overflow: hidden; padding: 72px 0 40px; text-align: center; background: #f7f8ff; }
.hx-hero__in { position: relative; z-index: 1; }
.hx-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: 0; animation: hx-drift 18s ease-in-out infinite alternate; }
.hx-blob--a { width: 520px; height: 520px; left: -140px; top: -160px; background: radial-gradient(circle, #8b9cff, transparent 70%); }
.hx-blob--b { width: 560px; height: 560px; right: -160px; top: 120px; background: radial-gradient(circle, #f6a26b, transparent 70%); animation-duration: 22s; }
.hx-grid-bg { position: absolute; inset: 0; z-index: 0; background-image: linear-gradient(rgba(79,70,229,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(79,70,229,.06) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 20%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 30%, transparent 75%); }
@keyframes hx-drift { from { transform: translate(0,0) scale(1); } to { transform: translate(60px,40px) scale(1.12); } }
.hx-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); box-shadow: var(--shadow-sm); }
.hx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 0 rgba(22,163,74,.6); animation: hx-ping 2s infinite; }
@keyframes hx-ping { 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.hx-title { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.05; letter-spacing: -.02em; margin: 18px auto 16px; max-width: 900px; }
.hx-grad { background: linear-gradient(90deg, var(--primary), #8b5cf6, #ea7a3f, var(--primary)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: hx-gradient 8s linear infinite; }
@keyframes hx-gradient { to { background-position: 300% 0; } }
.hx-sub { font-size: 19px; color: var(--text-muted); max-width: 760px; margin: 0 auto 26px; line-height: 1.6; }
.hx-rotate { display: inline-block; color: var(--text); font-weight: 700; border-bottom: 3px solid rgba(99,102,241,.35); transition: opacity .3s, transform .3s; }
.hx-rotate.is-out { opacity: 0; transform: translateY(-8px); }
.hx-shine { position: relative; overflow: hidden; box-shadow: 0 10px 30px -10px rgba(79,70,229,.7); }
.hx-shine::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(110deg, transparent, rgba(255,255,255,.45), transparent); animation: hx-sweep 3.2s ease-in-out infinite; }
@keyframes hx-sweep { 60%, 100% { left: 130%; } }
.hx-ghost { background: #fff; }
.hx-stage { position: relative; max-width: 1040px; margin: 48px auto 0; perspective: 1600px; }
.hx-stage .hx-browser { transform: rotateX(14deg) scale(.96); transform-origin: top center; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); box-shadow: 0 40px 80px -30px rgba(30,27,75,.45); }
.hx-stage.is-in .hx-browser { transform: rotateX(0) scale(1); }
.hx-browser { border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--border); box-shadow: 0 24px 60px -24px rgba(30,27,75,.35); }
.hx-browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #f1f3f9; border-bottom: 1px solid var(--border); }
.hx-browser__bar i { width: 11px; height: 11px; border-radius: 50%; background: #e5484d; }
.hx-browser__bar i:nth-child(2) { background: #f5a524; } .hx-browser__bar i:nth-child(3) { background: #30a46c; }
.hx-browser__bar span { margin-left: 12px; font-size: 12px; color: var(--text-muted); background: #fff; border-radius: 6px; padding: 3px 12px; flex: 1; max-width: 360px; text-align: left; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.hx-browser img { display: block; width: 100%; height: auto; }
.hx-float { position: absolute; display: flex; gap: 10px; align-items: center; text-align: left; background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; box-shadow: 0 18px 40px -18px rgba(30,27,75,.45); font-size: 13px; animation: hx-bob 6s ease-in-out infinite; z-index: 2; }
.hx-float strong { display: block; font-size: 13px; } .hx-float small { color: var(--text-muted); }
.hx-float--1 { left: -40px; top: 22%; } .hx-float--2 { right: -36px; top: 46%; animation-delay: -2s; } .hx-float--3 { left: 8%; bottom: -18px; animation-delay: -4s; }
@keyframes hx-bob { 50% { transform: translateY(-12px); } }
.hx-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.hx-ic--blue { background: var(--primary); } .hx-ic--green { background: var(--green-600); } .hx-ic--amber { background: var(--amber-600); }
.hx-marquee { padding: 34px 0 10px; overflow: hidden; }
.hx-marquee__track { display: flex; gap: 12px; width: max-content; margin-top: 12px; animation: hx-scroll 32s linear infinite; }
.hx-marquee:hover .hx-marquee__track { animation-play-state: paused; }
@keyframes hx-scroll { to { transform: translateX(-50%); } }
.hx-chip { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.hx-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; text-align: center; }
.hx-stat strong { display: block; font-size: 40px; letter-spacing: -.02em; background: linear-gradient(135deg, var(--primary), #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-stat > span { color: var(--text-muted); font-size: 14px; }
.hx-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.hx-head h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.01em; margin: 6px 0 8px; }
.hx-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--primary); margin: 0; }
.hx-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; position: relative; }
.hx-steps::before { content: ''; position: absolute; top: 46px; left: 16%; right: 16%; height: 2px; background: linear-gradient(90deg, transparent, rgba(99,102,241,.4), transparent); }
.hx-step { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 28px 24px; text-align: center; box-shadow: var(--shadow-sm); }
.hx-step__no { position: absolute; top: 14px; right: 18px; font-weight: 800; font-size: 28px; color: rgba(99,102,241,.15); }
.hx-step__ic { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), #8b5cf6); box-shadow: 0 12px 24px -12px rgba(79,70,229,.8); }
.hx-step__ic .icon { width: 26px; height: 26px; }
.hx-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; margin: 0 0 88px; }
.hx-row--flip .hx-row__text { order: 2; }
.hx-row__text h3 { font-size: clamp(22px, 2.6vw, 30px); margin: 8px 0 14px; letter-spacing: -.01em; }
.hx-row__text .site-list li { font-size: 15px; padding: 5px 0; }
.hx-row__media .hx-browser { transition: transform .5s ease, box-shadow .5s ease; }
.hx-row__media:hover .hx-browser { transform: translateY(-6px); box-shadow: 0 36px 70px -28px rgba(30,27,75,.5); }
.hx-feat { display: flex; align-items: center; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; font-weight: 600; transition: transform .25s, box-shadow .25s, border-color .25s; transition-delay: var(--d, 0ms); }
.hx-feat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(99,102,241,.4); }
.hx-feat__ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--primary); flex: none; }
.hx-lift { transition: transform .25s, box-shadow .25s; position: relative; }
.hx-lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.hx-popular { border: 2px solid var(--primary); }
.hx-badge { position: absolute; top: -12px; right: 16px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.hx-cta { text-align: center; color: #fff; padding: 56px 24px; border-radius: 24px; background: linear-gradient(120deg, #4338ca, #7c3aed 55%, #ea7a3f); background-size: 200% 200%; animation: hx-gradient-bg 12s ease infinite; box-shadow: 0 30px 60px -30px rgba(67,56,202,.8); }
.hx-cta h2 { font-size: clamp(24px, 3.2vw, 36px); margin: 0 auto 10px; max-width: 760px; color: #fff; }
.hx-cta p { opacity: .9; margin-bottom: 22px; }
.hx-cta__btn { background: #fff; color: #3730a3; border-color: #fff; } .hx-cta__ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
@keyframes hx-gradient-bg { 50% { background-position: 100% 50%; } }
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
.hx-hero [data-reveal]:nth-child(2) { --d: 80ms; } .hx-hero [data-reveal]:nth-child(3) { --d: 160ms; } .hx-hero [data-reveal]:nth-child(4) { --d: 240ms; } .hx-hero [data-reveal]:nth-child(5) { --d: 300ms; }
.no-js [data-reveal] { opacity: 1; transform: none; }
@media (max-width: 900px) {
  .hx-row, .hx-row--flip { grid-template-columns: 1fr; gap: 24px; margin-bottom: 56px; }
  .hx-row--flip .hx-row__text { order: 0; }
  .hx-steps, .hx-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hx-steps::before { display: none; }
  .hx-float--1 { left: 4px; } .hx-float--2 { right: 4px; }
}
@media (max-width: 600px) {
  .hx-steps { grid-template-columns: 1fr; }
  .hx-float { font-size: 11px; padding: 7px 10px; } .hx-float small { display: none; } .hx-float--3 { display: none; }
  .hx-hero { padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-blob, .hx-grad, .hx-float, .hx-marquee__track, .hx-cta, .hx-shine::after, .hx-dot { animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hx-stage .hx-browser { transform: none; }
}

/* ---------- Public inner pages & plan cards ---------- */
.hx-hero--page { padding: 64px 0 56px; }
.hx-title--page { font-size: clamp(32px, 4.6vw, 54px); }
.hx-overlap { padding-top: 24px; }
.hx-switch { display: flex; width: max-content; max-width: 100%; margin: 0 auto 32px; gap: 4px; padding: 5px; border-radius: 999px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow-x: auto; }
.hx-switch button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: background .25s, color .25s; }
.hx-switch button.is-active { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -8px rgba(79,70,229,.8); }
.hx-save { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--green-50); color: var(--green-700); margin-left: 4px; }
.hx-switch button.is-active .hx-save { background: rgba(255,255,255,.2); color: #fff; }
.hx-plan-grid { display: grid; gap: 22px; align-items: stretch; }
.hx-plan-grid--1 { grid-template-columns: minmax(0, 420px); justify-content: center; }
.hx-plan-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 860px; margin: 0 auto; }
.hx-plan-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hx-plan-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hx-plan { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 26px 22px; box-shadow: var(--shadow-sm); transition: transform .3s, box-shadow .3s, border-color .3s; }
.hx-plan:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(30,27,75,.35); border-color: rgba(99,102,241,.35); }
.hx-plan--popular { border: 2px solid var(--primary); background: linear-gradient(180deg, #f5f6ff, #fff 40%); box-shadow: 0 30px 60px -32px rgba(79,70,229,.6); }
.hx-plan h3 { font-size: 20px; margin: 0; }
.hx-plan__desc { color: var(--text-muted); font-size: 14px; min-height: 40px; margin: 6px 0 14px; }
.hx-plan__price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hx-plan__price strong { font-size: 32px; letter-spacing: -.02em; transition: opacity .2s; }
.hx-plan__price strong.is-swap { opacity: 0; }
.hx-plan__price span { color: var(--text-muted); font-size: 14px; }
.hx-plan__custom { font-size: 28px !important; }
.hx-plan__note { color: var(--text-muted); font-size: 12px; min-height: 18px; margin: 4px 0 16px; }
.hx-plan__limits { list-style: none; padding: 14px 0; margin: 18px 0 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); display: grid; gap: 6px; font-size: 14px; }
.hx-plan__limits strong { color: var(--text); }
.hx-plan__inc { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 16px 0 4px; }
.hx-plan__features li { font-size: 14px; }
.hx-compare { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.hx-compare table { width: 100%; border-collapse: collapse; min-width: 640px; }
.hx-compare th, .hx-compare td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: center; font-size: 14px; }
.hx-compare thead th { position: sticky; top: 0; background: #f8f9ff; font-size: 15px; }
.hx-compare tbody th { text-align: left; font-weight: 500; }
.hx-compare__group th { background: var(--surface-muted); text-align: left !important; font-weight: 700 !important; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; color: var(--text-muted); }
.hx-compare tbody tr:hover td, .hx-compare tbody tr:hover th { background: #fafaff; }
.hx-yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-50); color: var(--green-600); }
.hx-no { color: var(--gray-300); }
.hx-faq { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; margin-bottom: 10px; transition: box-shadow .25s, border-color .25s; }
.hx-faq[open] { border-color: rgba(99,102,241,.4); box-shadow: var(--shadow); }
.hx-faq summary { list-style: none; cursor: pointer; font-weight: 600; padding: 16px 28px 16px 0; position: relative; }
.hx-faq summary::-webkit-details-marker { display: none; }
.hx-faq summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--primary); transition: transform .25s; }
.hx-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.hx-faq p { margin: 0 0 16px; color: var(--text-muted); line-height: 1.65; animation: hx-fade .3s ease; }
@keyframes hx-fade { from { opacity: 0; transform: translateY(-4px); } }
.hx-faq-layout, .hx-legal { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; align-items: start; }
.hx-faq-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 4px; }
.hx-faq-nav > a { padding: 9px 14px; border-radius: 10px; color: var(--text-muted); font-weight: 600; }
.hx-faq-nav > a:hover, .hx-faq-nav > a[aria-current] { background: var(--brand-50); color: var(--primary); text-decoration: none; }
.hx-faq-title { font-size: 22px; margin: 8px 0 14px; scroll-margin-top: 90px; }
.hx-faq-title:not(:first-child) { margin-top: 36px; }
.hx-subnav { position: sticky; top: 64px; z-index: 10; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.hx-subnav .site-wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; }
.hx-subnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; color: var(--text-muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.hx-subnav a:hover { background: var(--brand-50); color: var(--primary); text-decoration: none; }
.hx-row[id] { scroll-margin-top: 140px; }
.hx-step__ic--sm { width: 46px; height: 46px; margin: 0 0 6px; border-radius: 14px; }
.hx-step__ic--sm .icon { width: 22px; height: 22px; }
.hx-ind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.hx-ind { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); }
.hx-ind__top { display: flex; justify-content: space-between; align-items: flex-start; }
.hx-ind h3 { margin: 10px 0 4px; font-size: 19px; }
.hx-contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
.hx-contact__info { display: grid; gap: 14px; }
.hx-info { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; transition: transform .25s, box-shadow .25s; }
.hx-info:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.hx-form { padding: 28px; border-radius: 20px; box-shadow: 0 30px 60px -36px rgba(30,27,75,.4); }
.hx-sent { text-align: center; padding: 40px 24px; }
.hx-sent > .icon { width: 44px; height: 44px; color: var(--green-600); }
.hx-legal .site-prose h2 { margin-top: 22px; }
.site-prose .alert { margin-bottom: 18px; }
@media (max-width: 1000px) { .hx-plan-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .hx-plan-grid--3, .hx-ind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-faq-layout, .hx-legal, .hx-contact { grid-template-columns: 1fr; }
  .hx-faq-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .hx-subnav { top: 92px; }
}
@media (max-width: 600px) { .hx-plan-grid--2, .hx-plan-grid--3, .hx-plan-grid--4, .hx-ind-grid { grid-template-columns: 1fr; } }
.is-disabled { pointer-events: none; opacity: .5; }

/* Industry detail pages */
.hx-crumbs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; color: var(--text-muted); }
.hx-crumbs a { color: inherit; text-decoration: none; } .hx-crumbs a:hover { color: var(--primary); }
.hx-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-tags .hx-chip { font-size: 13px; padding: 6px 12px; white-space: normal; }
.hx-narrow { max-width: 860px; }
.hx-card-link { display: block; color: inherit; text-decoration: none; }
.hx-card-link:hover h3 { color: var(--primary); }
.hx-steps--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.hx-ind__more { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; font-weight: 600; text-decoration: none; }
.mb-1 { margin-bottom: 4px; }
@media (max-width: 900px) { .hx-steps--4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .hx-steps--4 { grid-template-columns: 1fr; } }

/* Blog & comparison pages */
.hx-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.hx-cats a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.hx-cats a span { opacity: .6; font-weight: 500; margin-left: 2px; }
.hx-blog-search { display: flex; gap: 8px; max-width: 520px; margin: -8px auto 28px; }
.hx-blog-search .input { flex: 1; min-width: 0; }
.hx-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 32px; }
.hx-pager a { min-width: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; text-align: center; font-weight: 600; text-decoration: none; color: var(--text-muted); }
.hx-pager a[aria-current] { background: var(--primary, #4f46e5); border-color: var(--primary, #4f46e5); color: #fff; }
.hx-post__img { display: block; width: 100%; height: auto; aspect-ratio: 40 / 21; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.hx-article__img { margin: 0 0 24px; } .hx-article__img img { display: block; width: 100%; height: auto; border-radius: 14px; }
.hx-preview-bar { position: sticky; top: 0; z-index: 50; background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; padding: 10px 16px; text-align: center; font-size: 14px; }
.hx-cats a[aria-current="page"], .hx-cats a:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.06); }
.hx-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.hx-post { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.hx-post h2, .hx-post h3 { font-size: 18px; line-height: 1.35; margin: 4px 0 8px; }
.hx-post__cat { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); margin: 0; }
.hx-post__meta { color: var(--text-muted); margin-top: auto; margin-bottom: 0; }
.hx-article__head { padding: 48px 0 20px; background: linear-gradient(180deg, rgba(99,102,241,.07), transparent); }
.hx-article__head .hx-crumbs { justify-content: flex-start; }
.hx-article__head h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; letter-spacing: -.02em; margin: 6px 0 12px; }
.hx-article__grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 20px; padding-bottom: 56px; max-width: 1120px; }
.hx-toc { position: sticky; top: 90px; align-self: start; font-size: 14px; }
.hx-toc ol { list-style: none; padding: 0; margin: 8px 0 0; border-left: 2px solid var(--border); }
.hx-toc li a { display: block; padding: 5px 0 5px 12px; color: var(--text-muted); text-decoration: none; line-height: 1.35; }
.hx-toc li a:hover { color: var(--primary); }
.hx-article__main { max-width: 760px; }
.hx-answer { border: 1px solid rgba(99,102,241,.25); background: rgba(99,102,241,.06); border-radius: 16px; padding: 18px 20px; margin-bottom: 20px; }
.hx-answer p:last-child { margin: 0; font-size: 17px; line-height: 1.6; }
.hx-takeaways { border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px; margin-bottom: 24px; background: #fff; }
.hx-takeaways p { margin: 0 0 6px; }
.hx-prose { font-size: 17px; line-height: 1.75; color: var(--text); }
.hx-prose h2 { font-size: 26px; line-height: 1.25; margin: 40px 0 12px; scroll-margin-top: 90px; letter-spacing: -.01em; }
.hx-prose h3 { font-size: 20px; margin: 28px 0 8px; scroll-margin-top: 90px; }
.hx-prose p, .hx-prose ul, .hx-prose ol { margin: 0 0 16px; }
.hx-prose ul, .hx-prose ol { padding-left: 22px; }
.hx-prose li { margin-bottom: 6px; }
.hx-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.hx-prose blockquote { margin: 20px 0; padding: 12px 18px; border-left: 4px solid var(--primary); background: var(--surface-muted); border-radius: 0 12px 12px 0; }
.hx-table { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: 12px; }
.hx-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.hx-table th, .hx-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.hx-table th { background: var(--surface-muted); font-weight: 700; }
.hx-table tr:last-child td { border-bottom: 0; }
.hx-article__faq { margin-top: 40px; }
.hx-article__faq h2 { font-size: 26px; margin-bottom: 14px; }
.hx-author { display: flex; gap: 14px; align-items: center; margin-top: 32px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.hx-tags--center { justify-content: center; }
.hx-tags a.hx-chip { text-decoration: none; }
.hx-tags a.hx-chip:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 960px) { .hx-post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .hx-article__grid { grid-template-columns: 1fr; gap: 16px; } .hx-toc { display: none; } }
@media (max-width: 600px) { .hx-post-grid { grid-template-columns: 1fr; } .hx-prose { font-size: 16px; } .hx-prose h2 { font-size: 22px; } }
.hx-article__headin { max-width: 1120px; padding-left: calc(240px + 48px + 20px); }
@media (max-width: 960px) { .hx-article__headin { padding-left: 20px; } }
@media (max-width: 420px) { .site-nav { font-size: 13px; gap: 12px; } }

/* Add / edit dialog */
body.has-modal { overflow: hidden; }
.modal--form { padding: 4vh 16px; align-items: flex-start; backdrop-filter: blur(3px); background: rgba(17, 20, 32, .5); }
.modal--form.is-open { animation: mf-fade .18s ease-out; }
.modal--form.is-open .modal__dialog { animation: mf-pop .22s cubic-bezier(.2, .8, .3, 1.2); }
.modal--form.is-shake .modal__dialog { animation: mf-shake .35s; }
.modal__dialog--form { max-width: 880px; max-height: 92vh; border-radius: 18px; overflow: hidden; }
.modal--form .modal__header { padding: 18px 24px; background: linear-gradient(180deg, var(--surface-muted), var(--surface)); }
.modal--form .modal__header h2 { margin: 0; font-size: 19px; }
.modal__eyebrow { margin: 0 0 2px; font-size: 12px; color: var(--text-muted); }
.modal--form .btn-icon { font-size: 22px; line-height: 1; width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.modal--form .modal__body { padding: 20px 24px 0; overscroll-behavior: contain; }
.modal--form .modal__body > .card, .modal--form .modal__body form.card { border: 0; box-shadow: none; background: transparent; margin-bottom: 16px; }
.modal--form .modal__body .card__body { padding: 0; }
.modal--form .form-section { border-radius: 14px; }
.modal--form .form-actions { position: sticky; bottom: 0; z-index: 2; margin: 16px -24px 0; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 16px -12px rgba(0, 0, 0, .15); }
.modal--form .alert { margin-bottom: 14px; }
.modal--form button.is-loading { opacity: .75; cursor: progress; }
.modal-skeleton { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 4px 0 24px; }
.modal-skeleton span { height: 58px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-muted) 25%, var(--border) 50%, var(--surface-muted) 75%); background-size: 200% 100%; animation: mf-shimmer 1.2s infinite linear; }
.modal-skeleton span:nth-child(5) { grid-column: 1 / -1; height: 96px; }
@keyframes mf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mf-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes mf-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes mf-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 640px) {
  .modal--form { padding: 0; align-items: flex-end; }
  .modal__dialog--form { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal--form.is-open .modal__dialog { animation: mf-up .25s ease-out; }
  .modal--form .modal__body { padding: 16px 16px 0; }
  .modal--form .form-actions { margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal--form .form-actions .btn { flex: 1; justify-content: center; }
}
@keyframes mf-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal--form.is-open, .modal--form.is-open .modal__dialog, .modal-skeleton span { animation: none; } }

/* Checkout e-mail verification */
.hx-otp { display: flex; gap: 8px; }
.hx-otp .input { max-width: 200px; letter-spacing: .3em; font-weight: 700; font-size: 18px; text-align: center; }
.hx-otp .btn { white-space: nowrap; }
.hx-verified { display: inline-flex; align-items: center; gap: 6px; color: #15803d; font-weight: 600; margin: 4px 0 0; }
.field-help.hx-ok { color: #15803d; }

/* Trial ended (locked workspace) */
.locked { display: flex; justify-content: center; padding: 32px 0; }
.locked__card { max-width: 720px; width: 100%; text-align: center; }
.locked__card .card__body { padding: 36px 32px; }
.locked__card h1 { font-size: 26px; margin: 12px 0 8px; }
.locked__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.locked__icon .icon { width: 30px; height: 30px; }
.locked__plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.locked__plan { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.locked__plan:hover { border-color: var(--primary); transform: translateY(-2px); }
.locked .alert { text-align: left; }
.hx-otp .input::placeholder { letter-spacing: normal; font-weight: 400; font-size: 15px; }
[data-email-verify] { margin-bottom: 8px; }

/* Lead Finder */
.lf-search__grid > .form-field { grid-column: auto; }
.lf-search__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px 16px; align-items: end; }
.lf-search .label { display: flex; align-items: center; gap: 6px; }
.lf-search__actions { display: flex; gap: 8px; }
.lf-table td { vertical-align: top; }
.lf-addr { max-width: 280px; }
@media (max-width: 1100px) { .lf-search__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lf-search__actions { grid-column: 1 / -1; } }
@media (max-width: 600px) { .lf-search__grid { grid-template-columns: 1fr; } }
.lf-del { position: relative; display: inline-block; }
.lf-del summary { list-style: none; cursor: pointer; }
.lf-del summary::-webkit-details-marker { display: none; }
.lf-del[open] form { position: absolute; right: 0; top: 110%; z-index: 5; display: flex; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.lf-del .input--sm { height: 30px; width: 120px; }

/* Checkout add-ons */
.site-addons { display: grid; gap: 8px; }
.site-addon { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff; }
.site-addon.is-active, .site-addon:has(input:checked) { border-color: var(--primary); background: rgba(99,102,241,.05); }
.site-addon__text { display: flex; flex-direction: column; gap: 2px; }
.site-addon__qty { width: 80px; text-align: center; }
