/* ==========================================================================
   GBX Inmo — Panel design system
   ========================================================================== */

:root {
  --scroll-thumb: rgba(20, 23, 26, .18); --scroll-thumb-hover: rgba(20, 23, 26, .34);
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --paper: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --surface-3: #f1efe9;
  --ink: #15171a;
  --ink-2: #3d4148;
  --muted: #6f737a;
  --faint: #9a9da3;
  --line: #e6e3db;
  --line-2: #efece5;
  --brand: #0f5b4f;
  --brand-ink: #ffffff;
  --brand-soft: #e3efec;
  --brand-hover: #0b4a40;
  --brass: #a8834a;
  --brass-soft: #f4ecdd;

  --ok: #1d7a46;      --ok-soft: #e4f3ea;
  --warn: #9a6200;    --warn-soft: #fbf0d9;
  --bad: #b42318;     --bad-soft: #fbe7e5;
  --info: #1f5fa8;    --info-soft: #e5eef9;
  --violet: #6440b8;  --violet-soft: #eee8fa;
  --neutral-soft: #eeede8;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .05);
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 6px 20px -8px rgba(20, 22, 26, .12);
  --shadow-lg: 0 20px 50px -20px rgba(20, 22, 26, .35);

  --sidebar-w: 248px;
  --topbar-h: 60px;
  color-scheme: light;
}

[data-theme="dark"] {
  --scroll-thumb: rgba(236, 234, 229, .14); --scroll-thumb-hover: rgba(236, 234, 229, .28);
  --paper: #0f1113;
  --surface: #16191c;
  --surface-2: #1a1d21;
  --surface-3: #20242a;
  --ink: #eceae5;
  --ink-2: #c5c3be;
  --muted: #8e9198;
  --faint: #676a71;
  --line: #2a2e34;
  --line-2: #23272c;
  --brand: #3aa58f;
  --brand-ink: #07110f;
  --brand-soft: #16302b;
  --brand-hover: #4bb9a2;
  --brass: #d1ac6d;
  --brass-soft: #2e271b;
  --ok: #4cc583;   --ok-soft: #15291e;
  --warn: #e3ac45; --warn-soft: #2e2512;
  --bad: #f2766b;  --bad-soft: #321a18;
  --info: #6aa7ee; --info-soft: #162436;
  --violet: #a98bf0; --violet-soft: #241c38;
  --neutral-soft: #24282d;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
hr { border-color: var(--line); opacity: 1; }
::selection { background: var(--brand-soft); color: var(--ink); }
.mono { font-family: var(--font-mono); font-size: .86em; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.text-muted, .muted { color: var(--muted) !important; }
.text-faint { color: var(--faint) !important; }
.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
.fs-xs { font-size: 12px; }
.fs-sm { font-size: 13px; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .2s ease;
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 18px;
  border-bottom: 1px solid var(--line-2);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 19px; line-height: 1;
}
.brand-text { font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.brand-text small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px 24px; }
.nav-group { margin-bottom: 18px; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint);
  padding: 0 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; position: relative;
}
.nav-item i { font-size: 18px; color: var(--muted); width: 20px; text-align: center; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item.active i { color: var(--brand); }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--ink-2);
  padding: 1px 7px; border-radius: 20px; font-variant-numeric: tabular-nums;
}
.nav-item.active .count { background: var(--brand); color: var(--brand-ink); }
.sidebar-foot { border-top: 1px solid var(--line-2); padding: 12px; }
.plan-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; font-size: 12px;
}
.plan-card .bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.plan-card .bar span { display: block; height: 100%; background: var(--brass); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--topbar-h);
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.content { padding: 24px; max-width: 1480px; width: 100%; margin: 0 auto; flex: 1; }
.impersonation-bar {
  background: var(--ink); color: var(--paper); font-size: 13px; padding: 7px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.impersonation-bar button { background: transparent; border: 1px solid rgba(255,255,255,.3); color: inherit; border-radius: 6px; padding: 2px 10px; font-size: 12px; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 40px; }
}

/* ---------------------------------------------------------------- topbar parts */
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink-2); position: relative; flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn i { font-size: 19px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--paper); }
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 70px 0 38px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.global-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.global-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
.global-search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono);
  font-size: 11px; color: var(--muted); background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 440px; overflow-y: auto; display: none; padding: 6px;
}
.search-results.open { display: block; }
.search-results .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px 4px; font-weight: 600; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.search-results a:hover, .search-results a.focus { background: var(--surface-3); }
.search-results .thumb { width: 38px; height: 30px; border-radius: 5px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex: none; }
.search-results .meta { font-size: 12px; color: var(--muted); }
.search-empty { padding: 18px; text-align: center; color: var(--muted); }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; border-radius: 30px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.user-chip:hover { border-color: var(--faint); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brass-soft); color: var(--brass);
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 72px; height: 72px; font-size: 22px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.page-head .crumbs a { color: var(--muted); }
.page-head .crumbs a:hover { color: var(--ink); }
.page-title { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.02em; line-height: 1.15; }
.page-title em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--brass); }
.page-sub { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --bs-btn-font-size: 14px; --bs-btn-font-weight: 500; --bs-btn-padding-x: 14px; --bs-btn-padding-y: 7px;
  --bs-btn-border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn i { font-size: 17px; }
.btn-sm { --bs-btn-padding-x: 10px; --bs-btn-padding-y: 4px; --bs-btn-font-size: 13px; --bs-btn-border-radius: 7px; }
.btn-sm i { font-size: 15px; }
.btn-lg { --bs-btn-padding-y: 10px; --bs-btn-padding-x: 20px; --bs-btn-font-size: 15px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: var(--brand-ink); --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover); --bs-btn-hover-color: var(--brand-ink); --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 2px rgba(15,91,79,.3); }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-color: var(--paper); --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-border-color: var(--ink-2); --bs-btn-hover-color: var(--paper); }
.btn-outline, .btn-light {
  --bs-btn-bg: var(--surface); --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--faint);
  --bs-btn-active-bg: var(--surface-3); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--faint);
  box-shadow: var(--shadow-sm);
}
.btn-ghost { --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-color: var(--ink); --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: var(--surface-3); --bs-btn-active-border-color: transparent; }
.btn-danger-soft { --bs-btn-bg: var(--bad-soft); --bs-btn-color: var(--bad); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--bad); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--bad); }
.btn-whatsapp { --bs-btn-bg: #1f8f4e; --bs-btn-color: #fff; --bs-btn-border-color: #1f8f4e; --bs-btn-hover-bg: #187640; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #187640; }
.btn-icon { --bs-btn-padding-x: 0; width: 34px; height: 34px; }
.btn-icon.btn-sm { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- cards */
.card-x { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-x + .card-x { margin-top: 16px; }
.card-x .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-x .card-head h3, .card-x .card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.card-x .card-head .sub { font-size: 12px; color: var(--muted); }
.card-x .card-body-x { padding: 18px; }
.card-x .card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 12px; }

/* KPI */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; height: 100%; }
.kpi .k-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.kpi .k-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k-foot { font-size: 12px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 20px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--neutral-soft); }

/* ---------------------------------------------------------------- badges / chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 1;
  padding: 4px 8px; border-radius: 6px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-brand { background: var(--brand-soft); color: var(--brand); }
.chip-brass { background: var(--brass-soft); color: var(--brass); }
.chip-outline { background: transparent; border: 1px solid var(--line); }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); }

.status-draft { background: var(--neutral-soft); color: var(--muted); }
.status-available { background: var(--ok-soft); color: var(--ok); }
.status-reserved { background: var(--warn-soft); color: var(--warn); }
.status-sold, .status-rented { background: var(--info-soft); color: var(--info); }
.status-inactive { background: var(--bad-soft); color: var(--bad); }
.cstatus-new { background: var(--info-soft); color: var(--info); }
.cstatus-contacted { background: var(--neutral-soft); color: var(--ink-2); }
.cstatus-qualified { background: var(--violet-soft); color: var(--violet); }
.cstatus-visiting { background: var(--brass-soft); color: var(--brass); }
.cstatus-negotiating { background: var(--warn-soft); color: var(--warn); }
.cstatus-won { background: var(--ok-soft); color: var(--ok); }
.cstatus-lost { background: var(--bad-soft); color: var(--bad); }
.cstatus-nurturing { background: var(--brand-soft); color: var(--brand); }
.temp-hot { color: var(--bad); } .temp-warm { color: var(--warn); } .temp-cold { color: var(--info); }

/* ---------------------------------------------------------------- toolbar / filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.search-input { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search-input i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input input { padding-left: 34px !important; }
.seg-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 14px; border-bottom: 1px solid var(--line-2); scrollbar-width: none; }
.seg-tabs::-webkit-scrollbar { display: none; }
.seg-tabs a {
  padding: 11px 10px 10px; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent;
  margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center;
}
.seg-tabs a:hover { color: var(--ink); }
.seg-tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }
.seg-tabs a .n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.seg-tabs a.active .n { color: var(--ink-2); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 3px 4px 3px 10px; color: var(--ink-2); }
.filter-chip a { color: var(--muted); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; }
.filter-chip a:hover { background: var(--surface-3); color: var(--bad); }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.view-toggle a { padding: 6px 9px; color: var(--muted); display: grid; place-items: center; }
.view-toggle a.active { background: var(--surface-3); color: var(--ink); }
.bulk-bar {
  --bb-bg: #17191c; --bb-fg: #f4f2ee; --bb-line: rgba(255,255,255,.14); --bb-soft: rgba(255,255,255,.07);
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2);
  transform: translateX(-50%); z-index: 1040; width: max-content; max-width: calc(100vw - var(--sidebar-w) - 32px);
  display: none; align-items: center; gap: 8px; background: var(--bb-bg); color: var(--bb-fg); padding: 8px 8px 8px 16px;
  border: 1px solid var(--bb-line); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.45); flex-wrap: wrap;
  animation: bbIn .2s ease;
}
[data-theme="dark"] .bulk-bar { --bb-bg: #23272c; --bb-line: rgba(255,255,255,.12); }
@keyframes bbIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bulk-bar.show { display: flex; }
.bulk-bar .fs-sm { margin-right: 4px; white-space: nowrap; }
.bb-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 12px;
  border-radius: 9px; background: var(--bb-soft); border: 1px solid var(--bb-line); font-size: 13px; font-weight: 500; white-space: nowrap; max-width: 220px;
}
.bb-btn span { overflow: hidden; text-overflow: ellipsis; }
.bb-btn:hover, .bb-btn[aria-expanded="true"] { background: rgba(255,255,255,.13); }
.bb-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 60%, #fff); outline-offset: 2px; }
.bb-btn .chev { font-size: 14px; opacity: .6; transition: transform .15s; }
.bb-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.bb-menu { min-width: 220px; max-height: 300px; overflow-y: auto; }
.bb-menu .dropdown-item.active { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.bb-input { height: 34px; width: 150px; border-radius: 9px; background: var(--bb-soft); border: 1px solid var(--bb-line); color: var(--bb-fg); padding: 0 12px; font-size: 13px; outline: none; }
.bb-input::placeholder { color: rgba(255,255,255,.45); }
.bb-input:focus { border-color: rgba(255,255,255,.4); }
.bb-apply { all: unset; cursor: pointer; height: 34px; padding: 0 16px; border-radius: 9px; background: var(--bb-fg); color: #17191c; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
.bb-apply:hover { background: #fff; }
.bb-x { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: rgba(255,255,255,.55); font-size: 16px; }
.bb-x:hover { background: var(--bb-soft); color: #fff; }
@media (max-width: 991.98px) { .bulk-bar { left: 50%; max-width: calc(100vw - 24px); } }
@media (max-width: 575.98px) { .bulk-bar { padding: 8px; gap: 6px; } .bulk-bar .fs-sm { width: 100%; padding-left: 4px; } .bb-btn { max-width: 160px; } }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl thead th {
  position: sticky; top: 0; background: var(--surface-2); z-index: 1; text-align: left; font-weight: 600; font-size: 12px;
  color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .01em;
}
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.selected { background: var(--brand-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .chk { width: 36px; padding-right: 0; }
.tbl .row-link { color: var(--ink); font-weight: 500; }
.tbl .row-link:hover { color: var(--brand); }
.tbl .actions { width: 1%; white-space: nowrap; text-align: right; }
.th-sort { color: inherit; display: inline-flex; align-items: center; gap: 3px; }
.th-sort i { font-size: 13px; opacity: .45; }
.th-sort:hover { color: var(--ink); }
.th-sort.is-active { color: var(--ink); }
.th-sort.is-active i { opacity: 1; }
.prop-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.prop-thumb { width: 64px; height: 48px; border-radius: 7px; object-fit: cover; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--faint); overflow: hidden; position: relative; }
.prop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prop-thumb .n { position: absolute; right: 3px; bottom: 3px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 0 4px; border-radius: 4px; }
.prop-title { font-weight: 500; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prop-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.specs { display: flex; gap: 10px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.specs span { display: inline-flex; align-items: center; gap: 3px; }
.specs i { color: var(--faint); font-size: 14px; }
.meter { width: 54px; height: 5px; background: var(--line); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; }
.meter span { display: block; height: 100%; border-radius: 4px; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .ill { width: 64px; height: 64px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }
.empty-state .ill i { font-size: 30px; }
.empty-state h4 { font-size: 16px; color: var(--ink); margin-bottom: 4px; }

/* grid view of properties */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; padding: 14px; }
.pcard { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.pcard .ph { aspect-ratio: 4/3; background: var(--surface-3); position: relative; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph .chip { position: absolute; left: 8px; top: 8px; }
.pcard .ph .feat { position: absolute; right: 8px; top: 8px; background: var(--ink); color: var(--paper); }
.pcard .pb { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .price { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pager .pages a, .pager .pages span {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; display: inline-grid; place-items: center;
  color: var(--ink-2); border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.pager .pages a:hover { background: var(--surface-3); }
.pager .pages .current { background: var(--ink); color: var(--paper); font-weight: 600; }
.pager .pages .disabled { color: var(--faint); }
.pager .per-page { display: flex; align-items: center; gap: 6px; }
.pager .per-page select { height: 30px; padding: 0 26px 0 8px; font-size: 13px; width: auto; }

/* ---------------------------------------------------------------- forms */
.form-label { font-weight: 500; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.form-label .opt { color: var(--faint); font-weight: 400; }
.form-control, .form-select {
  background-color: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 9px;
  font-size: 14px; padding: 8px 11px; min-height: 38px; box-shadow: inset 0 1px 1px rgba(20,22,26,.02);
}
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background-color: var(--surface); color: var(--ink); }
.form-control-sm, .form-select-sm { min-height: 32px; padding: 4px 9px; font-size: 13px; border-radius: 7px; }
.form-select { background-position: right 10px center; padding-right: 30px; }
[data-theme="dark"] .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a0a3a9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-text { color: var(--muted); font-size: 12px; }
.input-group-text { background: var(--surface-3); border-color: var(--line); color: var(--muted); font-size: 13px; border-radius: 9px; }
.form-check-input { border: 1.5px solid var(--faint); background-color: var(--surface); width: 1.1em; height: 1.1em; margin-top: .2em; cursor: pointer; }
.form-check-input[type=checkbox] { border-radius: 5px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }
.form-check-input:checked[type=checkbox] { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
[data-theme="dark"] .form-check-input:checked[type=checkbox] { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2307110f' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-check { display: flex; align-items: flex-start; gap: .55em; padding-left: 0; min-height: 1.4em; }
.form-check .form-check-input { float: none; margin-left: 0; flex: none; }
.form-switch { padding-left: 0; }
.form-switch .form-check-input { width: 2.2em; height: 1.2em; margin-left: 0; border-radius: 2em; background-color: var(--line); border-color: var(--line);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); background-position: right center;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:focus { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
[data-theme="dark"] .form-switch .form-check-input:not(:checked) { background-color: var(--surface-3); border-color: var(--faint); }
.is-invalid { border-color: var(--bad) !important; }
.invalid-feedback { color: var(--bad); font-size: 12px; }
.form-section { padding: 20px 0; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > .fs-head { margin-bottom: 14px; }
.form-section > .fs-head h3 { font-size: 15px; margin: 0; }
.form-section > .fs-head p { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.check-tile { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; user-select: none; background: var(--surface); }
.check-tile:hover { border-color: var(--faint); }
.check-tile input { margin: 0; }
.check-tile:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); color: var(--ink); }
.check-tile .form-check-input { margin-top: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.radio-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 12px 34px 12px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--surface); transition: border-color .15s, background .15s; }
.radio-card:hover { border-color: var(--faint); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card::after { content: ""; position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--faint); background: var(--surface); transition: all .15s; }
.radio-card:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.radio-card:has(input:checked)::after { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.radio-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-soft); }
.radio-card i { font-size: 20px; color: var(--muted); }
.radio-card:has(input:checked) i { color: var(--brand); }
.radio-card strong { font-size: 13px; }
.radio-card small { color: var(--muted); font-size: 12px; }
.color-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 4px 8px 4px 4px; background: var(--surface); }
.color-input input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; border-radius: 6px; cursor: pointer; }
.color-input input[type=text] { border: 0; background: transparent; width: 90px; font-family: var(--font-mono); font-size: 13px; color: var(--ink); outline: none; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 20px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* tabs (form sections) */
.tabs-x { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs-x::-webkit-scrollbar { display: none; }
.tabs-x button, .tabs-x a {
  background: none; border: 0; padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
}
.tabs-x button:hover, .tabs-x a:hover { color: var(--ink); }
.tabs-x .active { color: var(--ink); border-bottom-color: var(--brand); }
.tabs-x .badge-n { font-size: 11px; background: var(--surface-3); color: var(--ink-2); border-radius: 10px; padding: 0 6px; }
.tab-pane-x { display: none; }
.tab-pane-x.active { display: block; }

/* ---------------------------------------------------------------- media manager */
.dropzone {
  border: 1.5px dashed var(--faint); border-radius: var(--radius-lg); padding: 28px 18px; text-align: center; color: var(--muted);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dropzone i { font-size: 30px; display: block; margin-bottom: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.media-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); aspect-ratio: 4/3; cursor: grab; }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.media-item .doc { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.media-item .doc i { font-size: 30px; display: block; }
.media-item .cover-badge { position: absolute; left: 6px; top: 6px; background: var(--ink); color: var(--paper); font-size: 11px; padding: 2px 7px; border-radius: 5px; font-weight: 600; }
.media-item .label-badge { position: absolute; left: 6px; bottom: 6px; background: rgba(255,255,255,.92); color: #111; font-size: 11px; padding: 1px 6px; border-radius: 5px; }
.media-item .tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.media-item:hover .tools, .media-item:focus-within .tools { opacity: 1; }
.media-item .tools button { width: 28px; height: 28px; border-radius: 7px; border: 0; background: rgba(255,255,255,.95); color: #111; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.media-item .tools button:hover { background: #fff; color: var(--brand); }
.media-item .tools button.del:hover { color: var(--bad); }
.media-item.uploading { cursor: progress; }
.media-item.uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6); }
.media-item .prog { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; background: rgba(0,0,0,.15); border-radius: 4px; z-index: 2; overflow: hidden; }
.media-item .prog span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.sortable-ghost { opacity: .35; }
@media (hover: none) { .media-item .tools { opacity: 1; } }

/* ---------------------------------------------------------------- timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 44px; }
.timeline .t-icon { position: absolute; left: 0; top: 0; width: 31px; height: 31px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.timeline .t-icon i { font-size: 15px; }
.timeline .t-form .t-icon { background: var(--info-soft); color: var(--info); border-color: transparent; }
.timeline .t-whatsapp .t-icon { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.timeline .t-task .t-icon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.timeline .t-visit .t-icon { background: var(--brass-soft); color: var(--brass); border-color: transparent; }
.timeline .t-head { font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.timeline .t-head strong { font-weight: 600; }
.timeline .t-time { color: var(--faint); font-size: 12px; }
.timeline .t-body { margin-top: 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; white-space: pre-line; font-size: 13.5px; color: var(--ink-2); }

/* ---------------------------------------------------------------- misc */
.dl-grid { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; margin: 0; }
.dl-grid dt { color: var(--muted); font-weight: 400; }
.dl-grid dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.list-x { list-style: none; margin: 0; padding: 0; }
.list-x > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.list-x > li:last-child { border-bottom: 0; }
.progress-x { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress-x span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.progress-x.warn span { background: var(--warn); }
.progress-x.bad span { background: var(--bad); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--brass); background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.callout.info { border-left-color: var(--info); }
.callout.ok { border-left-color: var(--ok); }
.callout.bad { border-left-color: var(--bad); }
.code-box { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; overflow-x: auto; }
.code-box button { flex: none; }
.kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.chart-bars .b { flex: 1; background: var(--brand-soft); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; transition: background .15s; }
.chart-bars .b.has { background: var(--brand); opacity: .85; }
.chart-bars .b:hover { opacity: 1; background: var(--brass); }
.chart-bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font-size: 11px; padding: 3px 7px; border-radius: 5px; white-space: nowrap; z-index: 3; }
.hbar { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.hbar .t { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.hbar .t span { display: block; height: 100%; background: var(--brass); border-radius: 6px; }

/* dropdown / modal / offcanvas theming */
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--surface-3); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-link-active-bg: var(--brand-soft); --bs-dropdown-link-active-color: var(--brand); --bs-dropdown-divider-bg: var(--line); --bs-dropdown-header-color: var(--muted); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; font-size: 14px; }
.dropdown-item { border-radius: 7px; padding: 7px 10px; display: flex; align-items: center; gap: 8px; }
.dropdown-item i { font-size: 17px; color: var(--muted); }
.dropdown-item.text-danger i { color: inherit; }
.modal-content { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); color: var(--ink); }
.modal-header, .modal-footer { border-color: var(--line-2); }
.modal-title { font-size: 17px; font-weight: 600; }
.offcanvas { background: var(--surface); color: var(--ink); border-color: var(--line) !important; }
.offcanvas-header { border-bottom: 1px solid var(--line-2); }
.btn-close { filter: none; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* flash / toasts */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast-x { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 11px 12px 11px 14px; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn .25s ease; }
.toast-x i.lead { font-size: 18px; margin-top: 1px; }
.toast-x.ok i.lead { color: #6ee7a7; } .toast-x.bad i.lead { color: #ff9b91; } .toast-x.warn i.lead { color: #f5c76a; }
.toast-x .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; padding: 0 2px; }
.toast-x a { color: #9fe3d4; text-decoration: underline; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--paper); }
.auth-form { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 80px); }
.auth-form .inner { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.auth-form h1 { font-size: 30px; letter-spacing: -.025em; margin-bottom: 6px; }
.auth-form h1 em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--brass); }
.auth-side {
  position: relative; overflow: hidden; background: #0d201c; color: #efe9dd; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(900px 500px at 85% 10%, rgba(200,169,106,.22), transparent 60%),
  radial-gradient(700px 600px at 10% 100%, rgba(58,165,143,.28), transparent 60%); }
.auth-side .grid-lines { position: absolute; inset: 0; 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: 56px 56px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.auth-side > * { position: relative; }
.auth-side .quote { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; max-width: 560px; }
.auth-side .quote em { color: #d9b878; }
.auth-side .feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; max-width: 560px; font-size: 14px; color: #cfc7b7; }
.auth-side .feature-list div { display: flex; gap: 10px; align-items: flex-start; }
.auth-side .feature-list i { color: #d9b878; font-size: 18px; }
.auth-side .mock { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px; max-width: 420px; backdrop-filter: blur(6px); }
.auth-side .mock .row-m { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.auth-side .mock .row-m:last-child { border-bottom: 0; }
.auth-side .mock .pill { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(217,184,120,.2); color: #e8cf9c; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.otp-input { font-family: var(--font-mono); font-size: 24px; letter-spacing: .4em; text-align: center; }
@media (max-width: 991.98px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* print */
@media print {
  .sidebar, .topbar, .page-actions, .sticky-actions, .bulk-bar, .toast-stack { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}
#propPanes:has(#tab-media.active) .sticky-actions,
#propPanes:has(#tab-activity.active) .sticky-actions { display: none; }

/* ---------------------------------------------------------------- remote select */
.remote-select { position: relative; }
.remote-select .rs-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); display: none; }
.remote-select.has-value .rs-clear { display: block; }
.remote-select.has-value input[type=text] { padding-right: 30px; font-weight: 500; }
.rs-menu { position: absolute; z-index: 1080; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; padding: 4px; display: none; }
.rs-menu.open { display: block; }
.rs-menu button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: 7px; color: var(--ink); }
.rs-menu button:hover, .rs-menu button.focus { background: var(--surface-3); }
.rs-menu img, .rs-menu .ph { width: 38px; height: 30px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surface-3); }
.rs-menu small { display: block; color: var(--muted); font-size: 12px; }
.rs-menu .empty { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- kanban */
.kpi-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kpi-strip .it { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 12px; color: var(--muted); }
.kpi-strip .it b { display: block; color: var(--ink); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: calc(100vh - 290px); scroll-snap-type: x proximity; }
.k-col { flex: 0 0 292px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 250px); scroll-snap-align: start; }
.k-col.is-won { background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface-2)); }
.k-col.is-lost { background: color-mix(in srgb, var(--bad-soft) 45%, var(--surface-2)); }
.k-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line-2); }
.k-head .t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.k-head .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.k-head .n { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.k-head .sum { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.k-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 80px; }
.k-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; position: relative; }
.k-card:hover { border-color: var(--faint); box-shadow: var(--shadow); }
.k-card .k-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; margin-bottom: 6px; padding-right: 18px; }
.k-card .k-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.k-card .k-prop { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin: 6px 0; }
.k-card .k-prop img { width: 40px; height: 30px; border-radius: 5px; object-fit: cover; }
.k-card .k-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.k-card .k-foot .avatar { margin-left: auto; }
.k-card .stale { color: var(--warn); }
.k-card .k-menu { position: absolute; right: 6px; top: 6px; }
.k-empty { text-align: center; color: var(--faint); font-size: 12px; padding: 14px 4px; border: 1.5px dashed var(--line); border-radius: 10px; }
.k-list .sortable-ghost { opacity: .4; }
.k-list .sortable-chosen { box-shadow: var(--shadow-lg); }
.stage-row { display: grid; grid-template-columns: 22px 1fr 54px 76px 110px 32px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.stage-row .handle { cursor: grab; color: var(--faint); }
.stage-row input[type=color] { width: 54px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.stage-row.deleted { opacity: .4; text-decoration: line-through; }
@media (max-width: 600px) { .stage-row { grid-template-columns: 18px 1fr 44px 64px; } .stage-row .kind-sel, .stage-row .del-btn { grid-column: span 2; } }

/* ---------------------------------------------------------------- agenda */
.cal-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.cal-toolbar .range { font-weight: 600; font-size: 16px; margin: 0 6px; text-transform: capitalize; }
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: 58px repeat(var(--days), minmax(120px, 1fr)); min-width: calc(58px + var(--days) * 120px); }
.cal-day-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); padding: 8px 10px; text-align: left; }
.cal-day-head .dw { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.cal-day-head .dn { font-size: 20px; font-weight: 600; line-height: 1.1; }
.cal-day-head.today .dn { color: #fff; background: var(--brand); border-radius: 8px; display: inline-block; padding: 0 7px; }
.cal-corner { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.cal-times { position: relative; }
.cal-times div { height: var(--hour); font-size: 11px; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line-2); background-image: repeating-linear-gradient(to bottom, var(--line-2) 0, var(--line-2) 1px, transparent 1px, transparent var(--hour)); cursor: copy; }
.cal-col.today { background-color: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
.cal-col.weekend { background-color: color-mix(in srgb, var(--surface-3) 50%, transparent); }
.cal-ev { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 4px 7px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--ink); box-shadow: var(--shadow-sm); z-index: 2; }
.cal-ev:hover { box-shadow: var(--shadow); z-index: 4; }
.cal-ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .tm { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-ev.st-cancelled { opacity: .5; text-decoration: line-through; }
.cal-ev.st-done { opacity: .75; }
.cal-ev.st-confirmed::after { content: ""; position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.cal-list-day { padding: 14px 18px 4px; font-weight: 600; font-size: 13px; color: var(--muted); text-transform: capitalize; border-top: 1px solid var(--line-2); }
.cal-list-day:first-child { border-top: 0; }
.ev-row { display: flex; gap: 14px; align-items: center; padding: 10px 18px; cursor: pointer; }
.ev-row:hover { background: var(--surface-2); }
.ev-row .tm { width: 92px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; flex: none; }
.ev-row .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--c); flex: none; }
.kind-visit { --c: #0f5b4f; } .kind-call { --c: #1f5fa8; } .kind-meeting { --c: #6440b8; } .kind-signing { --c: #a8834a; } .kind-valuation { --c: #b45309; }
[data-theme="dark"] .kind-visit { --c: #3aa58f; } [data-theme="dark"] .kind-call { --c: #6aa7ee; } [data-theme="dark"] .kind-meeting { --c: #a98bf0; }
.astatus-scheduled { background: var(--info-soft); color: var(--info); } .astatus-confirmed { background: var(--ok-soft); color: var(--ok); }
.astatus-done { background: var(--neutral-soft); color: var(--ink-2); } .astatus-cancelled { background: var(--bad-soft); color: var(--bad); } .astatus-no_show { background: var(--warn-soft); color: var(--warn); }
.chips-radio { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-radio label { cursor: pointer; }
.chips-radio input { position: absolute; opacity: 0; }
.chips-radio span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 20px; font-size: 13px; background: var(--surface); }
.chips-radio input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { display: none; }
.stars label { font-size: 22px; color: var(--line); cursor: pointer; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--brass); }

/* ---------------------------------------------------------------- callouts extra */
.callout.warn { border-left-color: var(--warn); }

/* ---------------------------------------------------------------- WhatsApp: números */
.wa-avatar { border-radius: 12px; background: var(--surface-3); color: var(--faint); }
.wa-avatar.on { background: color-mix(in srgb, #25d366 16%, var(--surface)); color: #1f8f4e; }
.wa-qr { position: relative; width: 264px; height: 264px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.wa-qr img { width: 244px; height: 244px; image-rendering: pixelated; }
.wa-qr-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); background: #fff; }
.wa-code { font-size: 30px; letter-spacing: .18em; text-align: center; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); font-weight: 500; }

/* ---------------------------------------------------------------- bandeja */
.content:has(> .inbox) { max-width: none; padding: 0; }
.inbox {
  --ib-out: color-mix(in srgb, #25d366 15%, var(--surface));
  --ib-ai: color-mix(in srgb, var(--violet) 11%, var(--surface));
  display: grid; grid-template-columns: 340px minmax(0, 1fr) auto; height: calc(100dvh - var(--topbar-h));
  background: var(--surface); border-top: 0; position: relative; overflow: hidden;
}
.ib-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: var(--surface); }
.ib-list-head { padding: 16px 14px 8px; }
.ib-list-head .search-input { max-width: none; min-width: 0; }
.ib-filters { padding: 0 8px; }
.ib-filters a { font-size: 12.5px; padding: 9px 7px 8px; }
.ib-items { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 0; }
.ib-item { all: unset; box-sizing: border-box; display: flex; gap: 10px; width: 100%; padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent; }
.ib-item:hover { background: var(--surface-2); }
.ib-item.active { background: var(--surface-3); border-left-color: var(--brand); }
.ib-item .avatar { width: 40px; height: 40px; flex: none; font-size: 13px; }
.ib-item-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ib-item-top, .ib-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ib-item-name { font-weight: 500; flex: 1; }
.ib-item.unread .ib-item-name { font-weight: 700; }
.ib-item-time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
.ib-item.unread .ib-item-time { color: #1f8f4e; font-weight: 600; }
.ib-item-prev { font-size: 12.5px; color: var(--muted); flex: 1; }
.ib-item.unread .ib-item-prev { color: var(--ink-2); }
.ib-item-meta { font-size: 11px; color: var(--faint); }
.ib-item-meta i { margin-right: 3px; }
.ib-unread { min-width: 19px; height: 19px; border-radius: 10px; background: #1f9d55; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; flex: none; }
.ib-flag { font-size: 13px; flex: none; line-height: 1; }
.ib-flag.ai { color: var(--violet); }
.ib-flag.human { color: var(--warn); }
.ib-more, .ib-older { all: unset; display: block; margin: 10px auto; font-size: 12.5px; color: var(--brand); cursor: pointer; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.ib-empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ib-empty i { font-size: 28px; color: var(--faint); }
.ib-skel { height: 58px; margin: 6px 14px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: ibSkel 1.2s infinite; }
@keyframes ibSkel { to { background-position: -200% 0; } }

.ib-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); }
.ib-placeholder { flex: 1; display: grid; place-items: center; }
.ib-thread-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ib-thread-inner[hidden] { display: none; }
.ib-thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 60px; }
.ib-ai-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.ib-ai-toggle.on { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 35%, transparent); background: var(--violet-soft); }
.ib-ai-toggle.paused { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.dropdown-item.active, .dropdown-item:active { background: var(--surface-3); color: var(--ink); }
.ib-banner { border-bottom: 1px solid var(--line); }
.ib-banner-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; }
.ib-banner-row.bad { background: var(--bad-soft); color: var(--bad); }
.ib-banner-row.warn { background: var(--warn-soft); color: var(--ink); }
.ib-banner-row.warn > i { color: var(--warn); }
.ib-banner-row.info { background: var(--info-soft); color: var(--ink); }
.ib-messages {
  flex: 1; overflow-y: auto; min-height: 0; padding: 16px clamp(12px, 3vw, 40px);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px); background-size: 18px 18px;
}
.ib-loading { display: grid; place-items: center; padding: 40px; color: var(--muted); }
.ib-day { text-align: center; margin: 14px 0 10px; }
.ib-day span { font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; text-transform: capitalize; }
.ib-msg { display: flex; margin: 3px 0; }
.ib-msg.out { justify-content: flex-end; }
.ib-bubble { max-width: min(560px, 78%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-top-left-radius: 4px; padding: 6px 9px 4px; box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.ib-msg.out .ib-bubble { background: var(--ib-out); border-color: color-mix(in srgb, #25d366 25%, var(--line)); border-radius: 12px; border-top-right-radius: 4px; }
.ib-msg.out.ai .ib-bubble { background: var(--ib-ai); border-color: color-mix(in srgb, var(--violet) 25%, var(--line)); }
.ib-text { font-size: 14px; line-height: 1.45; white-space: normal; }
.ib-text a { text-decoration: underline; }
.ib-foot { display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 10.5px; color: var(--faint); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ib-who { margin-right: auto; color: var(--muted); }
.ib-msg.ai .ib-who { color: var(--violet); }
.ib-foot .ti { font-size: 14px; }
.ib-foot .read { color: #34b7f1; }
.ib-foot .failed { color: var(--bad); }
.ib-err { font-size: 11.5px; color: var(--bad); margin-top: 3px; }
.ib-media { display: block; margin: -2px -5px 4px; border-radius: 8px; overflow: hidden; max-width: 320px; }
.ib-media img, video.ib-media { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.ib-sticker { width: 120px; height: 120px; object-fit: contain; }
.ib-doc { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; background: var(--surface-3); font-size: 13px; margin-bottom: 3px; }
audio { max-width: 260px; height: 36px; }
.ib-composer { padding: 10px 14px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.ib-composer-row { display: flex; align-items: flex-end; gap: 6px; }
.ib-composer textarea { resize: none; min-height: 40px; max-height: 160px; border-radius: 20px; padding: 9px 14px; line-height: 1.4; }
.ib-composer .btn-icon { flex: none; }
.ib-attach-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ib-attach-preview img { height: 64px; border-radius: 8px; border: 1px solid var(--line); }
.ib-attach-preview[hidden] { display: none; }

.ib-info { width: 300px; border-left: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
.ib-info[hidden] { display: none; }
.ib-info-head { text-align: center; padding: 22px 16px 16px; border-bottom: 1px solid var(--line-2); }
.ib-info-head .avatar { margin: 0 auto; }
.ib-dl { padding: 12px 16px; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.ib-dl dt { color: var(--muted); font-weight: 500; }
.ib-dl dd { margin: 0; min-width: 0; }
.ib-sec { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.ib-sec .tag { margin: 0 2px 4px 0; }
.ib-sec-t { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; margin-bottom: 6px; }

@media (max-width: 1199.98px) {
  .ib-info { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; box-shadow: var(--shadow-lg); }
}
@media (max-width: 991.98px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .ib-list { border-right: 0; }
  .ib-thread { display: none; }
  .inbox.show-thread .ib-list { display: none; }
  .inbox.show-thread .ib-thread { display: flex; }
  .ib-info { width: min(320px, 92vw); }
  .ib-bubble { max-width: 86%; }
  .ib-ai-toggle span { display: none; }
}

/* ---------------------------------------------------------------- agente IA: playground */
.days-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.days-grid .check-tile { justify-content: center; text-transform: capitalize; padding: 8px 4px; gap: 5px; }
@media (max-width: 575.98px) { .days-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ai-play { position: sticky; top: calc(var(--topbar-h) + 16px); }
.ai-play-phone { margin: 0 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; height: min(560px, 62vh); background: var(--surface-2); }
.ai-play-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ai-play-bar strong { display: block; font-size: 13.5px; line-height: 1.2; }
.ai-play-bar small { font-size: 11.5px; color: var(--muted); }
.ai-play-msgs { flex: 1; overflow-y: auto; padding: 12px; background-image: radial-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.ai-play-msgs .ib-bubble { max-width: 86%; }
.ai-play-hint { font-size: 12.5px; color: var(--muted); text-align: center; padding: 30px 16px; }
.ai-play-input { display: flex; gap: 6px; padding: 8px; background: var(--surface); border-top: 1px solid var(--line); }
.ai-play-input .form-control { border-radius: 20px; }
.ap-sample { all: unset; cursor: pointer; font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.ap-sample:hover { border-color: var(--brand); color: var(--brand); }
.ap-card { display: flex; gap: 10px; align-items: center; max-width: 86%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; font-size: 13px; }
.ap-card img { width: 64px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
.ap-card strong { display: block; font-size: 13px; }
.ap-card small { display: block; font-size: 11.5px; color: var(--muted); }
.ap-event > i { font-size: 22px; color: var(--ok); flex: none; padding: 0 4px; }
.ap-event.warn > i { color: var(--warn); }
.dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: dotPulse 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ib-item .avatar { position: relative; overflow: visible; }
.ib-ch { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; background: #1f9d55; color: #fff; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--surface); }
.ib-ch.web { background: var(--info); }

/* ---------------------------------------------------------------- redes sociales */
.page-tabs { border-bottom: 1px solid var(--line); padding: 0; }
.sp-row { display: flex; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line-2); align-items: flex-start; }
.sp-row:hover { background: var(--surface-2); }
.sp-thumb { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--faint); font-size: 24px; position: relative; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-thumb span { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10.5px; padding: 1px 5px; border-radius: 6px; }
.sp-caption { font-size: 13.5px; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-acc { position: relative; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); }
.sp-acc.ok::after, .sp-acc.bad::after, .sp-acc.wait::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); }
.sp-acc.ok::after { background: var(--ok); } .sp-acc.bad::after { background: var(--bad); } .sp-acc.wait::after { background: var(--warn); }
.sp-acc .s { display: none; }
a.sp-acc:hover { background: var(--c); color: #fff; }
.sp-av { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); font-size: 20px; }
.sp-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sp-av img + i { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--surface); }
.sp-connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sp-connect form { margin: 0; }
.sp-connect-btn { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px; font-weight: 500; }
.sp-connect-btn > i:first-child { font-size: 20px; color: var(--c); }
.sp-connect-btn span { flex: 1; }
.sp-connect-btn .ok { color: var(--ok); } .sp-connect-btn .add { color: var(--faint); }
.sp-connect-btn:hover:not(:disabled) { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.sp-connect-btn:disabled { opacity: .5; cursor: not-allowed; }
.sp-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-pick-item { cursor: pointer; margin: 0; }
.sp-pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.sp-pick-item span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; border: 1px solid var(--line); border-radius: 22px; font-size: 13px; background: var(--surface); color: var(--muted); transition: all .15s; }
.sp-pick-item span i { font-size: 17px; color: var(--faint); }
.sp-pick-item input:checked + span { border-color: var(--c); color: var(--ink); background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--c); }
.sp-pick-item input:checked + span i { color: var(--c); }
.sp-pick-item input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.sp-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sp-media.sm { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.sp-media-item, .sp-add { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; margin: 0; border: 2px solid transparent; background: var(--surface-3); }
.sp-media-item input { position: absolute; opacity: 0; }
.sp-media-item img, .sp-add img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s, filter .15s; }
.sp-media-item:not(.on) img { opacity: .45; filter: grayscale(.6); }
.sp-media-item.on { border-color: var(--brand); }
.sp-media-item .n { position: absolute; top: 5px; right: 5px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.sp-media-item:not(.on) .n { background: rgba(255,255,255,.85); border: 1px solid var(--line); }
.sp-media-item.upload .n { background: var(--info); }
.sp-add { padding: 0; }
.sp-add i { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 20px; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .15s; }
.sp-add:hover i { opacity: 1; }
.sp-media-extra { margin-top: 12px; }
.sp-media-extra:empty { display: none; }
.sp-preview-wrap { position: sticky; top: calc(var(--topbar-h) + 16px); }
.sp-preview { max-width: 420px; margin: 0 auto; background: #fff; color: #111; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); font-size: 13.5px; }
.sp-preview-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.sp-preview-head strong { font-size: 13px; }
.sp-preview-img { aspect-ratio: 4 / 5; background: #f1f1f1 center / cover no-repeat; display: grid; place-items: center; color: #bbb; font-size: 40px; position: relative; }
.sp-preview-img.has > i { display: none; }
.sp-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.sp-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.sp-dots i.on { background: #fff; }
.sp-preview-actions { display: flex; gap: 14px; padding: 10px 12px 4px; font-size: 22px; }
.sp-preview-text { padding: 2px 12px 14px; line-height: 1.45; overflow-wrap: anywhere; }
.sp-preview-text .ht { color: #00376b; }
@media (max-width: 575.98px) { .sp-row { flex-wrap: wrap; } .sp-thumb { width: 56px; height: 56px; } }
body:has(.bulk-bar.show) .content { padding-bottom: 96px; }

/* ---------------------------------------------------------------- scrollbars (finas, del tema, sin flechas) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background-color: var(--scroll-thumb); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; min-height: 36px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}
/* Paneles internos: la barra aparece solo al pasar el mouse */
.sidebar-nav, .ib-items, .ib-messages, .ib-info, .bb-menu, .dropdown-menu, .ai-play-msgs, .kanban .k-list, .offcanvas-body { --scroll-thumb: transparent; }
.sidebar-nav:hover, .ib-items:hover, .ib-messages:hover, .ib-info:hover, .bb-menu:hover, .dropdown-menu:hover, .ai-play-msgs:hover, .kanban .k-list:hover, .offcanvas-body:hover { --scroll-thumb: rgba(128, 128, 128, .32); }
.sidebar-nav::-webkit-scrollbar, .ib-items::-webkit-scrollbar, .dropdown-menu::-webkit-scrollbar { width: 8px; }
.sidebar-nav { scrollbar-gutter: stable; }

/* ---------------------------------------------------------------- bandeja: filtros visibles (sin scroll horizontal) */
.ib-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 12px; border-bottom: 1px solid var(--line-2); overflow: visible; }
.ib-filters a {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); border: 1px solid var(--line); background: var(--surface); margin: 0; white-space: nowrap; line-height: 1.5;
}
.ib-filters a:hover { color: var(--ink); border-color: var(--faint); }
.ib-filters a.active { color: var(--brand-ink, #fff); background: var(--brand); border-color: var(--brand); }
.ib-filters a i { font-size: 13px; }
.ib-filters a .n { font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); display: inline-grid; place-items: center; }
.ib-filters a .n:empty { display: none; }
.ib-filters a.active .n { background: rgba(255,255,255,.22); color: inherit; }
