/* ═══════════════════════════════════════════════════════════════
   LexCRM design system — enterprise B2B, desktop-first, mobile-friendly
   ═══════════════════════════════════════════════════════════════ */
:root {
  --brand: #4f46e5;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e6e8ef;
  --border-strong: #d4d8e2;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a6;
  --side-bg: #0f172a;
  --side-text: #cbd5e1;
  --side-muted: #64748b;
  --side-hover: rgba(255,255,255,.06);
  --success: #059669; --warning: #d97706; --danger: #dc2626; --info: #2563eb;
  --radius: 10px; --radius-sm: 7px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 40px rgba(15,23,42,.16);
  --side-w: 248px;
  --top-h: 60px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 8px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.ico { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; vertical-align: -3px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
[hidden] { display: none !important; }

/* ─────────── Shell ─────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; transition: transform .2s ease; }
body:has(.tenant-banner) .sidebar { top: 40px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 13px; flex-shrink: 0; }
.brand-mark.platform { background: linear-gradient(135deg, #6366f1, #0ea5e9); }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; background: #fff; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--side-muted); }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px; }
.nav-section { color: var(--side-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; margin-bottom: 1px; }
.nav-item:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-item .ico { width: 17px; height: 17px; opacity: .85; }
.nav-count { margin-left: auto; font-style: normal; background: var(--brand); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; font-weight: 600; }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--side-text); padding: 6px; border-radius: 8px; }
.me:hover { background: var(--side-hover); text-decoration: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--side-muted); }
.sidebar .icon-btn { color: var(--side-text); }
.sidebar .icon-btn:hover { background: var(--side-hover); }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30; }
body:has(.tenant-banner) .topbar { top: 40px; }
.topbar-title { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--text-2); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.tenant-banner { position: sticky; top: 0; z-index: 50; height: 40px; background: #b45309; color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 20px; font-size: 13px; }
.tenant-banner form { margin-left: auto; }
.sidebar-backdrop { display: none; }
.only-mobile { display: none !important; }

/* ─────────── Language switch ─────────── */
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; height: 30px; }
.lang-switch a { display: grid; place-items: center; padding: 0 9px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.lang-switch a:hover { background: var(--surface-2); text-decoration: none; }
.lang-switch a.active { background: var(--brand); color: #fff; }
.flag { width: 20px; height: 14px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12); display: block; }
.lang-btn { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.lang-btn:hover, .lang-drop.open .lang-btn { background: var(--surface-2); color: var(--text); }
.lang-btn .lang-caret { width: 14px; height: 14px; opacity: .6; transition: transform .15s; }
.lang-drop.open .lang-caret { transform: rotate(180deg); }
.lang-menu { min-width: 180px; padding: 4px; }
.lang-menu a { border-radius: 8px; }
.lang-menu a.active { font-weight: 650; }
.lang-menu .lang-check { width: 16px; height: 16px; margin-left: auto; color: var(--brand); }
.floating-lang { position: fixed; top: 16px; right: 16px; background: #fff; z-index: 20; }

/* ─────────── Search ─────────── */
.search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 0 12px; height: 38px; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); background: #fff; }
.search input { border: 0; background: transparent; outline: 0; flex: 1; font: inherit; height: 100%; min-width: 0; }
.search .ico { color: var(--muted); }
.search-pop { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 440px; overflow: auto; display: none; z-index: 60; }
.search-pop.open { display: block; }
.search-pop .grp { padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.search-pop a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--text); }
.search-pop a:hover, .search-pop a.sel { background: var(--surface-2); text-decoration: none; }
.search-pop a small { color: var(--muted); margin-left: auto; }

/* ─────────── Buttons & forms ─────────── */
.btn { 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(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-light { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-block { width: 100%; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 5px; color: var(--text-2); }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=datetime-local], input[type=time], input[type=search]:not(.search input), select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--text); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 15px; height: 15px; vertical-align: -2px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; margin: 0; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; }
.inline-form { display: inline; }

/* ─────────── Layout helpers ─────────── */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; } .row.gap-lg { gap: 16px; } .row.wrap { flex-wrap: wrap; } .row.center { justify-content: center; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.ml-auto { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.g-side-l { grid-template-columns: 320px minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-0 { margin-bottom: 0; }
.pad { padding: 16px; }
.center { text-align: center; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─────────── Cards ─────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 14.5px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; gap: 6px; align-items: center; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; font-weight: 600; }
.kpi .delta.up { color: var(--success); } .kpi .delta.down { color: var(--danger); }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); float: right; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 34px; height: 34px; margin-bottom: 8px; opacity: .5; }

/* ─────────── Tables ─────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--text); font-weight: 600; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-person .sub { color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.filters select, .filters input { width: auto; height: 32px; font-size: 13px; }
.filters input[type=search] { min-width: 220px; }
.pager { display: flex; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); gap: 8px; }
.pager-btns { margin-left: auto; display: flex; gap: 6px; }
.bulk-bar { display: none; gap: 8px; align-items: center; padding: 8px 14px; background: color-mix(in srgb, var(--brand) 7%, #fff); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.bulk-bar.show { display: flex; }

/* ─────────── Badges, pills, avatars ─────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; } .badge-indigo { background: #e0e7ff; color: #4338ca; } .badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-green { background: #d1fae5; color: #047857; } .badge-amber { background: #fef3c7; color: #b45309; } .badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red { background: #fee2e2; color: #b91c1c; } .badge-gray { background: #f1f5f9; color: #475569; } .badge-dark { background: #0f172a; color: #fff; }
.pill { --c: #94a3b8; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 75%, #000); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #f1f5f9; color: #334155; font-size: 11.5px; font-weight: 550; margin: 1px 2px 1px 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 16%, #fff); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.sidebar .avatar { background: rgba(255,255,255,.12); color: #fff; }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-bar { width: 44px; height: 6px; border-radius: 4px; background: #eef0f4; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #10b981); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-available { background: #10b981; } .status-busy { background: #f59e0b; } .status-away { background: #94a3b8; } .status-offline { background: #cbd5e1; }

/* ─────────── Alerts ─────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.floating { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; box-shadow: var(--shadow-lg); }

/* ─────────── Tabs ─────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--text-2); font-weight: 550; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; font: inherit; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: #eef0f4; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* ─────────── Dropdowns / modal ─────────── */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: 44px; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; z-index: 60; overflow: hidden; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 14px; color: var(--text); background: none; border: 0; text-align: left; font: inherit; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--surface-2); text-decoration: none; }
.notif-menu { width: 380px; max-height: 480px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--brand) 5%, #fff); }
.notif .t { font-weight: 600; font-size: 13px; } .notif .b { color: var(--text-2); font-size: 12.5px; } .notif .w { color: var(--muted); font-size: 11.5px; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; padding: 22px; }
.modal-card.wide { max-width: 820px; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 { margin-bottom: 16px; }

/* ─────────── Timeline / activity ─────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 40px; bottom: -4px; width: 1px; background: var(--border); }
.tl-icon { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex-shrink: 0; }
.tl-body { flex: 1; min-width: 0; }
.tl-body .meta { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; word-break: break-word; }
.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { font-size: 21px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ─────────── Kanban ─────────── */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: calc(100vh - 220px); align-items: flex-start; }
.column { flex: 0 0 280px; background: #eef0f5; border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.column-head { padding: 12px 12px 8px; display: flex; align-items: center; gap: 8px; font-weight: 650; }
.column-head .count { margin-left: auto; background: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.column-head .bar { width: 10px; height: 10px; border-radius: 3px; }
.column-sum { padding: 0 12px 8px; font-size: 12px; color: var(--muted); }
.column-body { padding: 4px 8px 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.column-body.drag-over { background: color-mix(in srgb, var(--brand) 8%, transparent); border-radius: 10px; }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: var(--shadow); }
.kcard.dragging { opacity: .5; transform: rotate(2deg); }
.kcard .name { font-weight: 600; color: var(--text); }
.kcard .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ─────────── Charts ─────────── */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; background: #eef0f4; border-radius: 6px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-step { display: grid; grid-template-columns: 150px 1fr 70px; gap: 12px; align-items: center; }
.funnel-step .track { height: 28px; background: #f1f3f7; border-radius: 7px; overflow: hidden; }
.funnel-step .track i { display: flex; align-items: center; padding-left: 10px; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #06b6d4)); color: #fff; font-size: 12px; font-weight: 600; border-radius: 7px; min-width: 32px; }

/* ─────────── Inbox ─────────── */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - var(--top-h) - 110px); min-height: 480px; }
.convo-list { border-right: 1px solid var(--border); overflow-y: auto; }
.convo { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.convo:hover { background: var(--surface-2); text-decoration: none; }
.convo.active { background: color-mix(in srgb, var(--brand) 7%, #fff); box-shadow: inset 3px 0 0 var(--brand); }
.convo .preview { color: var(--muted); font-size: 12.5px; }
.convo.unread .name { font-weight: 700; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.messages { flex: 1; overflow-y: auto; padding: 18px; background: #fafbfd; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 70%; padding: 9px 13px; border-radius: 14px; background: #fff; border: 1px solid var(--border); align-self: flex-start; white-space: pre-wrap; word-break: break-word; }
.msg.out { align-self: flex-end; background: var(--brand); border-color: var(--brand); color: #fff; }
.msg .m-meta { font-size: 11px; opacity: .7; margin-top: 4px; display: flex; gap: 6px; }
.msg.call, .msg.note { align-self: center; background: #f1f5f9; color: var(--text-2); font-size: 13px; }
.composer { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.composer textarea { min-height: 70px; }

/* ─────────── Calendar ─────────── */
#calendar { --fc-border-color: var(--border); --fc-today-bg-color: color-mix(in srgb, var(--brand) 6%, #fff); --fc-button-bg-color: #fff; --fc-button-text-color: var(--text); --fc-button-border-color: var(--border-strong); --fc-button-hover-bg-color: var(--surface-2); --fc-button-hover-border-color: var(--border-strong); --fc-button-active-bg-color: var(--brand); --fc-button-active-border-color: var(--brand); font-size: 13px; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 650; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ─────────── Automation builder ─────────── */
.builder { display: grid; grid-template-columns: 230px minmax(0, 1fr) 320px; height: calc(100vh - var(--top-h) - 118px); min-height: 560px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.palette { border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; background: var(--surface-2); }
.palette h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 12px 4px 6px; }
.palette-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: grab; font-weight: 550; font-size: 13px; user-select: none; }
.palette-item:hover { border-color: var(--brand); }
.palette-item .sw { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.palette-item .sw .ico { width: 14px; height: 14px; }
.canvas-wrap { position: relative; overflow: auto; background-color: #fbfbfd; background-image: radial-gradient(#dfe3ea 1px, transparent 1px); background-size: 20px 20px; }
.canvas { position: relative; width: 2400px; height: 2000px; }
.canvas svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.canvas svg.wires path { fill: none; stroke: #94a3b8; stroke-width: 2; pointer-events: stroke; cursor: pointer; }
.canvas svg.wires path:hover { stroke: var(--danger); stroke-width: 3; }
.canvas svg.wires text { font-size: 11px; font-weight: 700; fill: #64748b; }
.node { position: absolute; width: 220px; background: #fff; border: 1.5px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); cursor: move; user-select: none; }
.node.selected { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent), var(--shadow); }
.node-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--border); }
.node-head .sw { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.node-head .sw .ico { width: 14px; height: 14px; }
.node-head strong { font-size: 13px; }
.node-body { padding: 8px 11px 10px; font-size: 12px; color: var(--text-2); min-height: 20px; word-break: break-word; }
.port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #94a3b8; cursor: crosshair; }
.port:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 20%, #fff); }
.port.in { top: -8px; left: calc(50% - 7px); }
.port.out { bottom: -8px; left: calc(50% - 7px); }
.port.out.yes { left: 28%; border-color: #10b981; }
.port.out.no { left: 66%; border-color: #ef4444; }
.port-label { position: absolute; bottom: -24px; font-size: 10px; font-weight: 700; }
.inspector { border-left: 1px solid var(--border); overflow-y: auto; padding: 16px; }
.inspector h3 { margin-bottom: 12px; }
.builder-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.builder-toolbar input[name=name] { max-width: 360px; width: 360px; font-weight: 600; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; }
.switch input { appearance: none; width: 36px; height: 20px; background: #cbd5e1; border-radius: 12px; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(16px); }

/* ─────────── AI ─────────── */
.ai-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 130px); min-height: 480px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 85%; padding: 11px 14px; border-radius: 14px; white-space: pre-wrap; line-height: 1.55; }
.bubble.user { align-self: flex-end; background: var(--brand); color: #fff; }
.bubble.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); }
.bubble .engine { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; gap: 4px; align-items: center; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 12px; }
.suggest button { border: 1px solid var(--border-strong); background: #fff; border-radius: 20px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.suggest button:hover { border-color: var(--brand); color: var(--brand); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ai-card { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; animation: blink 1s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* ─────────── Auth / onboarding / public ─────────── */
body.blank { background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), radial-gradient(900px 500px at 110% 110%, rgba(14,165,233,.14), transparent), #f5f6fb; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 700; font-size: 17px; }
.auth-logo .brand-mark { width: 38px; height: 38px; }
.demo-creds { margin-top: 18px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 12.5px; }
.demo-creds code { font-size: 12px; }
.demo-creds button { font: inherit; border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; }
.err-code { font-size: 64px; font-weight: 800; color: var(--brand); letter-spacing: -0.04em; }
pre.debug { text-align: left; font-size: 11px; background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow: auto; max-height: 300px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span { flex: 1; min-width: 60px; height: 5px; border-radius: 4px; background: #e5e7eb; }
.steps span.done { background: var(--brand); }
.public-form { max-width: 620px; margin: 40px auto; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.integration { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.integration .logo { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.perm-table td, .perm-table th { text-align: center; padding: 8px 6px; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.dup-box { border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.code-block { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow-x: auto; white-space: pre; }
.health-ok { color: var(--success); } .health-bad { color: var(--danger); }

/* ─────────── Responsive ─────────── */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: minmax(0, 1fr) 300px; }
  .builder { grid-template-columns: 200px minmax(0, 1fr) 280px; }
}
@media (max-width: 1024px) {
  :root { --side-w: 264px; }
  .sidebar { transform: translateX(-100%); top: 0 !important; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid !important; }
  .g-side, .g-side-l, .ai-shell { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; height: auto; }
  .palette { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .palette h4 { display: none; }
  .palette-item { flex-shrink: 0; margin: 0; }
  .canvas-wrap { height: 60vh; }
  .inspector { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .hide-sm { display: none !important; }
  .g-2, .g-3, .g-4, .form-grid, .form-grid-3, .check-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .page-head h1 { font-size: 19px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .kpi .value { font-size: 22px; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; }
  .inbox.has-thread .convo-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .msg { max-width: 88%; }
  .notif-menu { width: calc(100vw - 24px); right: -8px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .funnel-step { grid-template-columns: 100px 1fr 54px; }
  .bar-row { grid-template-columns: 100px 1fr 40px; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 4px; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 10px; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .table.responsive td.no-label::before { content: none; }
  .auth-card { padding: 22px; }
  .column { flex-basis: 84vw; }
  .modal-card { padding: 18px; }
}

/* ═══════════ Split-screen login (per-firm branded) ═══════════ */
.auth-split-body { background: #fff; font-family: 'Jost', var(--font); color: #1f2a44; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; }
.auth-left { display: flex; flex-direction: column; padding: 28px 40px 28px 104px; min-width: 0; }
.auth-lang { display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 600; letter-spacing: .06em; color: #94a3b8; }
.auth-lang a { color: #1f2a44; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.auth-lang a:hover { text-decoration: none; color: var(--ovl); }
.auth-lang a.active { border-bottom-color: var(--ovl); }
.auth-form-wrap { width: 100%; max-width: 540px; margin: auto 0; padding: 48px 0 24px 104px; }
.auth-title { font-family: var(--lp-title-font, 'Jost', sans-serif); font-size: calc(46px * var(--lp-title-scale, 1)); font-weight: 600; color: var(--lp-title-color, #2b3f63); letter-spacing: -0.01em; margin-bottom: 14px; }
.auth-sub { font-family: var(--lp-subtitle-font, 'Jost', sans-serif); font-size: calc(20px * var(--lp-subtitle-scale, 1)); color: var(--lp-subtitle-color, #3f4d66); margin-bottom: 40px; }
.auth-form label { font-size: 16px; font-weight: 600; color: #1f2a44; margin: 0 0 10px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 30px; }
.auth-label-row a { font-size: 14px; font-weight: 600; color: #2b3f63; }
.auth-input { position: relative; display: flex; align-items: center; margin-bottom: 4px; }
.auth-input > svg:first-child, .auth-input > i:first-child { position: absolute; left: 20px; width: 20px; height: 20px; color: #3f4d66; pointer-events: none; }
.auth-input input { width: 100%; height: 66px; padding: 0 56px 0 58px; border: 1px solid #d5d9e0; border-radius: 6px; font: inherit; font-size: 19px; color: #1f2a44; background: #fff; }
.auth-input input::placeholder { color: #3f4d66; opacity: .9; }
.auth-input input:focus { outline: 0; border-color: var(--ovl); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ovl) 20%, transparent); }
.auth-eye { position: absolute; right: 14px; border: 0; background: none; color: #64748b; cursor: pointer; padding: 6px; display: grid; place-items: center; }
.auth-eye svg { width: 20px; height: 20px; }
.auth-form > label + .auth-input { margin-bottom: 0; }
.auth-form > label:first-of-type { display: block; }
.auth-submit { width: 100%; height: 68px; margin-top: 46px; border: 0; border-radius: 4px; background: #2b3f63; color: #fff; font: inherit; font-size: 20px; font-weight: 600; letter-spacing: .01em; cursor: pointer; transition: background .15s, transform .05s; }
.auth-submit:hover { background: #22324f; }
.auth-submit:active { transform: translateY(1px); }
.auth-alt { margin-top: 58px; text-align: center; font-size: 17px; color: #3f4d66; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.auth-alt a { color: #2b3f63; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; display: inline-flex; align-items: center; gap: 4px; }
.auth-alt svg { width: 18px; height: 18px; }
.auth-footer { text-align: center; font-size: 15px; color: #3f4d66; padding-left: 64px; margin: 0; }
.auth-form-wrap .alert { margin-bottom: 22px; font-size: 14px; }
.auth-form-wrap .demo-creds { margin-top: 26px; }
.auth-form-wrap .demo-creds summary { cursor: pointer; }
.auth-right { padding: 20px 20px 20px 0; min-width: 0; }
.auth-panel { position: relative; height: 100%; min-height: 560px; border-radius: 170px 42px 150px 42px; overflow: hidden; background-color: #2b3f63; background-size: cover; background-position: center; isolation: isolate; }
.auth-panel.no-image { background: linear-gradient(145deg, color-mix(in srgb, var(--ovl) 70%, #0f172a), #0f172a); }
.auth-panel-tint { position: absolute; inset: 0; background: var(--ovl); opacity: var(--ovl-op); mix-blend-mode: multiply; z-index: 0; }
.auth-panel.no-image .auth-panel-tint { display: none; }
.auth-panel-art { position: absolute; right: -60px; top: 12%; width: 70%; color: #fff; opacity: .5; z-index: 0; }
.auth-panel-logo { position: absolute; top: 48px; right: 64px; z-index: 1; max-width: min(85%, calc(45% * var(--lp-logo_image-scale, 1))); text-align: right; }
.auth-panel-logo img { max-width: 100%; max-height: calc(190px * var(--lp-logo_image-scale, 1)); object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }
.auth-panel-name { font-family: 'Libre Caslon Text', Georgia, serif; font-size: 34px; color: #fff; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.auth-panel-copy { position: absolute; left: 11%; right: 14%; bottom: 13%; z-index: 1; color: #fff; }
.auth-panel-copy h2 { color: var(--lp-headline-color, #fff); } .auth-panel-copy p { color: var(--lp-subtext-color, #fff); }
.auth-panel-copy h2 { font-family: var(--lp-headline-font, 'Libre Caslon Text', Georgia, serif); font-weight: 400; font-size: calc(clamp(32px, 3.4vw, 60px) * var(--lp-headline-scale, 1)); line-height: 1.12; letter-spacing: -0.01em; margin-bottom: 26px; text-shadow: 0 2px 12px rgba(0,0,0,.12); }
.auth-panel-copy p { font-family: var(--lp-subtext-font, 'Jost', sans-serif); font-size: calc(clamp(17px, 1.55vw, 27px) * var(--lp-subtext-scale, 1)); line-height: 1.35; max-width: 640px; margin: 0; }
@media (max-width: 1280px) {
  .auth-left { padding-left: 48px; }
  .auth-form-wrap { padding-left: 40px; }
  .auth-footer { padding-left: 20px; }
  .auth-title { font-size: calc(40px * var(--lp-title-scale, 1)); }
}
@media (max-width: 960px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-right { order: -1; padding: 12px 12px 0; }
  .auth-panel { min-height: 240px; height: 240px; border-radius: 26px; box-shadow: none; }
  .auth-panel-logo { top: 18px; right: 22px; } .auth-panel-logo img { max-height: calc(80px * var(--lp-logo_image-scale, 1)); } .auth-panel-name { font-size: 22px; }
  .auth-panel-copy { left: 22px; right: 22px; bottom: 20px; } .auth-panel-copy h2 { font-size: calc(26px * var(--lp-headline-scale, 1)); margin-bottom: 6px; } .auth-panel-copy p { display: none; }
  .auth-panel-art { width: 55%; top: 0; }
  .auth-left { padding: 20px 20px 24px; }
  .auth-lang { position: absolute; top: 26px; left: 26px; z-index: 3; background: rgba(255,255,255,.92); padding: 4px 10px; border-radius: 8px; }
  .auth-form-wrap { padding: 12px 0; max-width: none; }
  .auth-title { font-size: calc(32px * var(--lp-title-scale, 1)); } .auth-sub { font-size: calc(17px * var(--lp-subtitle-scale, 1)); margin-bottom: 26px; }
  .auth-input input { height: 56px; font-size: 17px; }
  .auth-submit { height: 58px; margin-top: 30px; font-size: 18px; }
  .auth-alt { margin-top: 32px; } .auth-footer { padding: 16px 0 0; }
}

/* ─────────── User menu (topbar) & profile photos ─────────── */
img.avatar { object-fit: cover; display: inline-block; background: var(--surface-2); }
.user-btn { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; font: inherit; color: var(--text); }
.user-btn:hover, .user-drop.open .user-btn { background: var(--surface-2); border-color: var(--border); }
.user-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; max-width: 170px; }
.user-btn-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.user-btn-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.user-caret { width: 15px; height: 15px; color: var(--muted); transition: transform .15s; }
.user-drop.open .user-caret { transform: rotate(180deg); }
.user-menu { min-width: 250px; top: 48px; }
.user-menu-head { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--border); }
.user-menu-head .avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.user-menu-head div { display: flex; flex-direction: column; min-width: 0; }
.user-menu-head strong { font-size: 14px; }
.user-menu-head small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu form { margin: 0; border-top: 1px solid var(--border); }
.user-menu .item.danger { color: var(--red, #dc2626); }
.photo-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.photo-edit .avatar.xl { width: 96px; height: 96px; font-size: 32px; }
.photo-edit .photo-actions { display: flex; flex-direction: column; gap: 8px; }
.photo-edit .photo-actions { align-items: flex-start; }
.menu-lang { display: none; align-items: center; gap: 8px; padding: 8px 14px; color: var(--text); }
.menu-lang .lang-switch { margin-left: auto; }
@media (max-width: 720px) {
  .menu-lang.show-sm { display: flex; }
  .user-btn { padding: 2px; }
  .topbar .search { min-width: 0; flex: 1; }
}

/* ─────────── Collapsible sidebar (desktop: icons only) ─────────── */
.nav-toggle { flex-shrink: 0; }
.sidebar, .main { transition: width .2s ease, margin-left .2s ease, transform .2s ease; }
@media (min-width: 1025px) {
  body.side-collapsed { --side-w: 68px; }
  body.side-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  body.side-collapsed .brand-text,
  body.side-collapsed .nav-item span { display: none; }
  body.side-collapsed .nav { padding: 10px 8px; overflow-x: hidden; }
  body.side-collapsed .nav-item { justify-content: center; padding: 10px 0; position: relative; }
  body.side-collapsed .nav-item .ico { width: 19px; height: 19px; }
  body.side-collapsed .nav-section { font-size: 0; padding: 8px 0 6px; margin: 6px 6px 0; border-top: 1px solid rgba(255,255,255,.1); }
  body.side-collapsed .nav-count { position: absolute; top: 4px; right: 6px; margin: 0; padding: 0 5px; font-size: 10px; line-height: 15px; }
}
.nav-tip { position: fixed; left: 76px; transform: translateY(-50%); background: #0f172a; color: #fff; font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-lg); pointer-events: none; z-index: 100; }
/* Icon-only row actions (tables) */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.row-actions .inline-form { margin: 0; }
.icon-btn.sm { width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); }
.icon-btn.sm:hover { background: var(--surface-2); }
.icon-btn.danger { color: var(--red, #dc2626); }
.icon-btn.danger:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
@media (max-width: 720px) { .row-actions { justify-content: flex-start; } }
/* Sileo toasts (assets/vendor/sileo) */
#sileo-root { position: relative; z-index: 1000; }
.sileo-btn-danger { background: #dc2626 !important; color: #fff !important; }
#sileo-root [data-sileo-title] { text-transform: none; }
/* ─────────── Two-factor authentication ─────────── */
.twofa-status { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.twofa-status .ico { width: 22px; height: 22px; }
.twofa-status.on { background: #dcfce7; color: #15803d; }
.twofa-status.off { background: #fef3c7; color: #b45309; }
.grow { flex: 1; min-width: 0; }
.btn-link { background: none; border: 0; color: var(--text-2); padding: 6px 0; cursor: pointer; font: inherit; text-decoration: underline; }
.setup-steps { padding-left: 18px; margin: 0 0 8px; display: grid; gap: 14px; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0 6px; }
.qr-box img, .qr-box canvas { display: block; }
.secret { display: inline-block; margin-top: 6px; padding: 6px 10px; background: var(--surface-2); border-radius: 6px; font-size: 13px; letter-spacing: .06em; }
.otp-input { width: 130px; font-size: 18px; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }
.key-list { display: grid; gap: 8px; margin-bottom: 10px; }
.key-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.key-row > .ico { color: var(--brand); width: 20px; height: 20px; }
.recovery-new { border-color: #fcd34d; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-width: 420px; }
.recovery-grid code { padding: 8px 10px; background: var(--surface-2); border-radius: 6px; text-align: center; font-size: 14px; letter-spacing: .05em; }
.auth-key { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-key svg { width: 22px; height: 22px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 26px 0 -20px; color: #64748b; font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid #d5d9e0; }
/* Quick-create lead modal */
#quickLead .ql-error { color: var(--danger); margin-top: 4px; }
#quickLead .ql-dups { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
#quickLead .ql-dup { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; cursor: pointer; }
/* ─────────── Practice area cards ─────────── */
.pa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pa-card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px 18px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,23,42,.04)); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.pa-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pa); }
.pa-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.pa-card.is-inactive { opacity: .72; }
.pa-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pa-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--pa); background: color-mix(in srgb, var(--pa) 13%, #fff); }
.pa-icon .ico { width: 20px; height: 20px; }
.pa-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pa-title h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-desc { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(13px * 1.45 * 2); }
.pa-types { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.pa-chip { max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 550; color: color-mix(in srgb, var(--pa) 70%, #0f172a); background: color-mix(in srgb, var(--pa) 10%, #fff); border: 1px solid color-mix(in srgb, var(--pa) 22%, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-chip.more { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.pa-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; margin-top: auto; }
.pa-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; }
a.pa-stat:hover { background: color-mix(in srgb, var(--pa) 10%, #fff); text-decoration: none; }
.pa-stat strong { font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pa-stat span { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-stat span .ico { width: 12px; height: 12px; flex-shrink: 0; }
.pa-stat.zero strong { color: var(--muted); font-weight: 600; }
.pa-team { display: flex; align-items: center; gap: 10px; min-width: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.pa-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); flex-shrink: 0; }
.pa-names { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.avatar-stack { display: flex; flex-shrink: 0; }
.avatar-stack > span { display: inline-flex; margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack > span:first-child { margin-left: 0; }
.avatar-stack .avatar.more { background: var(--surface-2); color: var(--text-2); font-size: 10px; }
/* ─────────── Public intake form ─────────── */
body.blank { min-height: 100vh; background-attachment: fixed; }
.pf-wrap { max-width: 680px; margin: 0 auto; padding: 56px 16px 32px; }
.pf-wrap.is-embed { max-width: none; padding: 8px; }
.pf-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 60px -24px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.04); overflow: hidden; }
.pf-head { padding: 30px 36px 24px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, #fff), #fff); border-bottom: 1px solid var(--border); }
.pf-firm { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; color: var(--text); margin-bottom: 22px; }
.pf-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; }
.pf-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; background: #fff; }
.pf-head h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.pf-head p { color: var(--text-2); margin: 0; font-size: 15px; line-height: 1.5; }
.pf-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pf-trust span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; }
.pf-trust .ico { width: 14px; height: 14px; color: var(--brand); }
.pf-form { padding: 8px 36px 30px; }
.pf-group { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
.pf-group legend { padding: 0; margin-bottom: 14px; font-size: 12px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-field.wide { grid-column: 1 / -1; }
.pf-field > label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pf-field .req { color: #dc2626; }
.pf-field .opt { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 4px; }
.pf-field input:not([type=checkbox]):not([type=radio]), .pf-field select, .pf-field textarea { width: 100%; min-height: 46px; padding: 11px 14px; font: inherit; font-size: 15px; color: var(--text); background: #fff; border: 1px solid #d6dae3; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.pf-field textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.pf-field input:focus, .pf-field select:focus, .pf-field textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.pf-field.has-error input, .pf-field.has-error select, .pf-field.has-error textarea { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.08); }
.pf-error { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #dc2626; }
.pf-error .ico { width: 14px; height: 14px; }
.pf-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.pf-choice { position: relative; cursor: pointer; }
.pf-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pf-choice span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 12px; border: 1px solid #d6dae3; border-radius: 10px; font-size: 14px; font-weight: 550; color: var(--text-2); transition: all .15s; }
.pf-choice span .ico { width: 16px; height: 16px; }
.pf-choice:hover span { border-color: color-mix(in srgb, var(--brand) 40%, #d6dae3); }
.pf-choice input:checked + span { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, #fff); color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.pf-choice input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.pf-submit { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 28px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: inherit; font-size: 16px; font-weight: 650; cursor: pointer; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 60%, transparent); transition: transform .06s, filter .15s; }
.pf-submit:hover { filter: brightness(1.07); }
.pf-submit:active { transform: translateY(1px); }
.pf-submit .ico { width: 18px; height: 18px; }
.pf-legal { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pf-legal .ico { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.pf-powered { text-align: center; font-size: 12.5px; color: var(--muted); margin: 22px 0 0; }
.pf-done { text-align: center; padding: 56px 32px; }
.pf-done-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; color: #15803d; }
.pf-done-icon .ico { width: 30px; height: 30px; }
.pf-done h1 { font-size: 22px; margin-bottom: 8px; }
@media (max-width: 600px) {
  .pf-wrap { padding: 64px 12px 24px; }
  .pf-head { padding: 24px 20px 20px; }
  .pf-form { padding: 4px 20px 24px; }
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-head h1 { font-size: 22px; }
}
/* Firm logo: uploader in settings, login header, sidebar */
.logo-uploader { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 14px; border: 1.5px dashed var(--border); border-radius: 12px; transition: border-color .15s, background .15s; }
.logo-uploader.drag { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.logo-preview { width: 200px; height: 88px; flex-shrink: 0; display: grid; place-items: center; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--border);
  background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), linear-gradient(-45deg, #f1f5f9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f1f5f9 75%), linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; background: #fff; padding: 4px 8px; border-radius: 6px; }
.logo-empty .ico { width: 22px; height: 22px; }
.logo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; flex: 1; }
.auth-brand { margin-bottom: 28px; }
.auth-brand img { display: block; max-height: calc(64px * var(--lp-logo_form-scale, 1)); max-width: min(100%, calc(260px * var(--lp-logo_form-scale, 1))); object-fit: contain; }
.brand-logo { object-fit: contain !important; padding: 3px; }
/* Sidebar header with the firm logo: white logo, name below, centered, no box */
.sidebar-brand.has-logo { flex-direction: column; justify-content: center; text-align: center; gap: 10px; padding: 22px 16px 16px; }
.sidebar-brand.has-logo .brand-logo { width: auto; height: auto; max-width: 170px; max-height: 54px; padding: 0 !important; border-radius: 0; background: none; object-fit: contain; filter: brightness(0) invert(1); }
.sidebar-brand.has-logo .brand-text { align-items: center; max-width: 100%; }
.sidebar-brand.has-logo .brand-text strong { font-size: 14.5px; }
@media (min-width: 1025px) {
  body.side-collapsed .sidebar-brand.has-logo { padding: 16px 6px 14px; }
  body.side-collapsed .sidebar-brand.has-logo .brand-logo { max-width: 44px; max-height: 32px; }
}
.auth-panel-logo.is-white img { filter: brightness(0) invert(1); }
/* White logos above the (white) login form: painted in the title color through a CSS mask */
.auth-brand-tint { display: block; height: calc(64px * var(--lp-logo_form-scale, 1)); max-width: min(100%, calc(260px * var(--lp-logo_form-scale, 1))); aspect-ratio: var(--ratio); background: var(--lp-title-color, #2b3f63);
  -webkit-mask: var(--logo) left center / contain no-repeat; mask: var(--logo) left center / contain no-repeat; }
/* Platform console: the Elevate logo already comes in a light version → keep its colors */
.sidebar-brand.is-platform .brand-logo { filter: none; max-height: 64px; }

/* ─────────── Login: fixed window, never scrolls ───────────
   The page is exactly the viewport; spacing and control sizes scale with the available height. */
html:has(.auth-split-body), .auth-split-body { height: 100%; overflow: hidden; }
.auth-split { height: 100vh; height: 100dvh; min-height: 0; }
.auth-left { height: 100%; min-height: 0; padding-top: clamp(14px, 3.2vh, 28px); padding-bottom: clamp(12px, 3.2vh, 28px); }
.auth-form-wrap { min-height: 0; padding-top: clamp(8px, 3vh, 48px); padding-bottom: clamp(6px, 1.5vh, 24px); }
.auth-brand { margin-bottom: clamp(10px, 2.6vh, 28px); }
.auth-brand img, .auth-brand-tint { max-height: min(calc(64px * var(--lp-logo_form-scale, 1)), 8vh); }
.auth-title { font-size: min(calc(46px * var(--lp-title-scale, 1)), 6.2vh); margin-bottom: clamp(4px, 1.3vh, 14px); line-height: 1.1; }
.auth-sub { font-size: min(calc(20px * var(--lp-subtitle-scale, 1)), 2.6vh); margin-bottom: clamp(12px, 3.6vh, 40px); }
.auth-form label { margin-bottom: clamp(4px, 1vh, 10px); }
.auth-label-row { margin-top: clamp(10px, 2.6vh, 30px); }
.auth-input input { height: clamp(44px, 7.2vh, 66px); font-size: clamp(15px, 2.2vh, 19px); }
.auth-submit { height: clamp(46px, 7.4vh, 68px); margin-top: clamp(14px, 4.2vh, 46px); font-size: clamp(16px, 2.4vh, 20px); }
.auth-alt { margin-top: clamp(12px, 4.6vh, 58px); font-size: clamp(14px, 2vh, 17px); }
.auth-form-wrap .alert { margin-bottom: clamp(8px, 2vh, 22px); }
.auth-form-wrap .demo-creds { margin-top: clamp(8px, 2vh, 26px); }
.auth-footer { font-size: clamp(12px, 1.8vh, 15px); flex-shrink: 0; }
.auth-right { height: 100%; min-height: 0; }
.auth-panel { min-height: 0; }
.auth-panel-logo { top: clamp(20px, 5vh, 48px); }
.auth-panel-logo img { max-height: min(calc(190px * var(--lp-logo_image-scale, 1)), 20vh); }
.auth-panel-copy { bottom: clamp(24px, 9vh, 13%); }
.auth-panel-copy h2 { font-size: min(calc(clamp(32px, 3.4vw, 60px) * var(--lp-headline-scale, 1)), 7.5vh); margin-bottom: clamp(8px, 2.4vh, 26px); }
.auth-panel-copy p { font-size: min(calc(clamp(17px, 1.55vw, 27px) * var(--lp-subtext-scale, 1)), 2.8vh); }
/* Last resort for extremely short windows: only the form column scrolls, never the page */
.auth-left { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.auth-left::-webkit-scrollbar { display: none; }
@media (max-width: 960px) {
  .auth-split { grid-template-rows: auto minmax(0, 1fr); }
  .auth-right { height: auto; }
  .auth-panel { height: clamp(110px, 22vh, 240px); min-height: 0; }
  .auth-panel-copy h2 { font-size: min(calc(26px * var(--lp-headline-scale, 1)), 3.4vh); }
  .auth-panel-logo img { max-height: min(calc(80px * var(--lp-logo_image-scale, 1)), 9vh); }
  .auth-left { padding: 12px 20px 14px; }
  .auth-title { font-size: min(calc(32px * var(--lp-title-scale, 1)), 4.8vh); }
  .auth-sub { font-size: min(calc(17px * var(--lp-subtitle-scale, 1)), 2.3vh); margin-bottom: clamp(10px, 2.4vh, 26px); }
  .auth-input input { height: clamp(42px, 6.2vh, 56px); }
  .auth-submit { height: clamp(44px, 6.4vh, 58px); margin-top: clamp(12px, 3vh, 30px); }
  .auth-alt { margin-top: clamp(10px, 2.6vh, 32px); }
  .auth-footer { padding-top: 8px; }
}
.auth-form-wrap { flex-shrink: 0; }
@media (max-width: 960px) {
  /* Phones: the top banner is just the image + logo; the form keeps all the room */
  .auth-panel { height: clamp(90px, 17vh, 190px); }
  .auth-panel-copy { display: none; }
  .auth-panel-logo { top: 50%; right: 22px; transform: translateY(-50%); }
  .auth-panel-logo img { max-height: min(calc(70px * var(--lp-logo_image-scale, 1)), 11vh); }
  .auth-brand { display: none; }
  .auth-form-wrap { margin: auto 0; }
}
/* Sign-up mode cards (System settings) */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-card { position: relative; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s, background .15s; }
.mode-card:hover .mode-body { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.mode-card input:checked + .mode-body { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); box-shadow: 0 0 0 1px var(--brand) inset; }
.mode-card input:focus-visible + .mode-body { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.mode-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mode-title .ico { color: var(--brand); }
.mode-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 720px) { .mode-grid { grid-template-columns: minmax(0, 1fr); } }
.invite-new { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: color-mix(in srgb, var(--brand) 4%, #fff); }
.invite-link { padding: 8px 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; word-break: break-all; flex: 1; min-width: 0; }
/* First-sign-in password rules */
.pwd-rules { list-style: none; padding: 0; margin: 10px 0 clamp(10px, 2.4vh, 24px); display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #64748b; }
.pwd-rules li::before { content: "○"; margin-right: 6px; }
.pwd-rules li.ok { color: #15803d; }
.pwd-rules li.ok::before { content: "✓"; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: #2b3f63; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.linklike svg { width: 16px; height: 16px; }
.temp-pwd-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 4px 0 12px; border-radius: 10px; background: #f0fdfa; border: 1px solid #99f6e4; color: #115e59; font-size: 13px; line-height: 1.45; }
.temp-pwd-note .ico { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
/* Segmented radio (Create user) */
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--text-2); }
.seg span .ico { width: 15px; height: 15px; }
.seg input:checked + span { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
/* ═══════════ Global loader ═══════════ */
.lx-loader { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px;
  background: rgba(248, 250, 252, .55); -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%);
  opacity: 0; transition: opacity .2s ease; }
.lx-loader.open { opacity: 1; }
.lx-loader[hidden] { display: none; }
html.lx-busy, html.lx-busy body { overflow: hidden; }
.lx-card { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(360px, 100%); padding: 34px 28px 26px; border-radius: 22px;
  background: rgba(255, 255, 255, .82); border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .35); transform: translateY(8px) scale(.98); transition: transform .25s ease; }
.lx-loader.open .lx-card { transform: none; }
.lx-logo { width: 92px; height: 92px; overflow: visible; }
.lx-arrow path { fill: #01abae; }
.lx-arrow { transform-origin: 70px 50px; animation: lx-rise 1.6s cubic-bezier(.45, 0, .2, 1) infinite; }
.lx-bar { fill: #0f172a; transform-box: fill-box; transform-origin: bottom; animation: lx-bar 1.6s cubic-bezier(.45, 0, .2, 1) infinite; }
.lx-bar.b2 { animation-delay: .12s; } .lx-bar.b3 { animation-delay: .24s; } .lx-bar.b4 { animation-delay: .36s; }
@keyframes lx-bar { 0%, 100% { transform: scaleY(.25); opacity: .35; } 35%, 70% { transform: scaleY(1); opacity: 1; } }
@keyframes lx-rise { 0%, 100% { transform: translate(-4px, 6px); opacity: .55; } 45%, 70% { transform: translate(3px, -6px); opacity: 1; } }
.lx-steps { min-height: 44px; display: grid; place-items: center; text-align: center; }
.lx-step { font: 600 15px/1.45 var(--font, system-ui); color: #0f172a; opacity: 0; transform: translateY(6px); }
.lx-step.in { animation: lx-in .35s ease forwards; }
@keyframes lx-in { to { opacity: 1; transform: none; } }
.lx-progress { position: relative; width: 100%; height: 4px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.lx-progress span { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: inherit; background: linear-gradient(90deg, #01abae, #0f172a); animation: lx-slide 1.3s ease-in-out infinite; }
@keyframes lx-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.lx-dots { display: flex; gap: 6px; min-height: 8px; }
.lx-dots i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; transition: background .2s, transform .2s; }
.lx-dots i.done { background: #01abae; }
.lx-dots i.on { background: #0f172a; transform: scale(1.25); }
@media (prefers-reduced-motion: reduce) {
  .lx-arrow, .lx-bar, .lx-progress span { animation: none; } .lx-bar { transform: none; opacity: 1; }
}
/* Admin user tables */
.status-stack { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status-stack .badge .ico, .badge .ico { width: 12px; height: 12px; vertical-align: -2px; }
.firm-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.firm-link .ico { width: 14px; height: 14px; color: var(--muted); }
.min0 { min-width: 0; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.ok { color: #15803d; } .icon-btn.ok:hover { background: #f0fdf4; border-color: #bbf7d0; }
.icon-btn.warn { color: #b45309; } .icon-btn.warn:hover { background: #fffbeb; border-color: #fde68a; }
.icon-btn.sm:hover { color: var(--brand); }
.icon-btn.sm.danger:hover { color: #b91c1c; }
/* Delete-user dialog */
.del-head { display: flex; gap: 12px; align-items: center; }
.del-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fee2e2; color: #b91c1c; flex-shrink: 0; }
.del-icon svg { width: 20px; height: 20px; }
.del-work { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.del-work li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.del-work li svg { width: 15px; height: 15px; color: var(--muted); }
/* Sileo: long descriptions wrap and can be selected (e.g. to copy a temporary password) */
#sileo-root [data-sileo-description] { white-space: normal; word-break: break-word; user-select: text; max-width: min(420px, calc(100vw - 48px)); }
#sileo-root [data-sileo-title] { max-width: min(420px, calc(100vw - 80px)); overflow: hidden; text-overflow: ellipsis; }
/* Loader without the white card: logo, step and progress float over the blurred page */
.lx-loader { background: rgba(248, 250, 252, .62); }
.lx-card { background: none; border: 0; box-shadow: none; padding: 0; }
.lx-step { text-shadow: 0 1px 12px rgba(255, 255, 255, .9); }
.lx-progress { width: min(260px, 70vw); background: rgba(15, 23, 42, .1); }
/* ─────────── Loader background: liquid glass ───────────
   Strong blur + saturation (colors glow through), soft moving light reflections,
   bright glass edges and a subtle specular gradient. */
.lx-loader {
  background:
    linear-gradient(135deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.12) 38%, rgba(255,255,255,.22) 62%, rgba(255,255,255,.08) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(185%) brightness(1.06) contrast(.96);
  backdrop-filter: blur(22px) saturate(185%) brightness(1.06) contrast(.96);
  overflow: hidden; isolation: isolate;
}
/* moving light reflections */
.lx-loader::before {
  content: ""; position: absolute; inset: -30%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 30% at 30% 28%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(30% 26% at 72% 70%, rgba(1,171,174,.20), transparent 72%),
    radial-gradient(26% 22% at 78% 22%, rgba(255,255,255,.35), transparent 70%),
    radial-gradient(34% 28% at 22% 78%, rgba(99,102,241,.12), transparent 72%);
  filter: blur(8px);
  animation: lx-caustics 9s ease-in-out infinite alternate;
}
/* glass edges: bright rim + inner depth */
.lx-loader::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 0 90px rgba(255,255,255,.35), inset 0 -40px 120px rgba(15,23,42,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 22%, transparent 78%, rgba(255,255,255,.18));
}
@keyframes lx-caustics {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(-3%, 4%, 0) rotate(-6deg) scale(1.02); }
}
.lx-step { text-shadow: 0 1px 1px rgba(255,255,255,.8), 0 0 18px rgba(255,255,255,.95); }
.lx-progress { background: rgba(255,255,255,.45); box-shadow: inset 0 1px 1px rgba(15,23,42,.08), 0 1px 0 rgba(255,255,255,.8); }
.lx-logo { filter: drop-shadow(0 6px 18px rgba(1,171,174,.25)) drop-shadow(0 2px 4px rgba(15,23,42,.12)); }
/* browsers without backdrop-filter: a frosted opaque fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lx-loader { background: rgba(241, 245, 249, .94); }
}
@media (prefers-reduced-motion: reduce) { .lx-loader::before { animation: none; } }
/* Firm login link (Super Admin) */
.login-link-card .card-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ll-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); flex-shrink: 0; }
.ll-icon .ico { width: 19px; height: 19px; }
.ll-text { min-width: 180px; }
.ll-url { flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.ll-actions { display: flex; gap: 6px; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.xs .ico { width: 14px; height: 14px; }
/* Outgoing email card */
.mail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.mail-box { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.mail-box.is-on { border-color: #86efac; background: #f0fdf4; }
.mail-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #fee2e2; color: #dc2626; flex-shrink: 0; }
.gmail-steps { margin: 12px 0; padding-left: 18px; display: grid; gap: 8px; color: var(--text-2); }
@media (max-width: 960px) { .mail-grid { grid-template-columns: minmax(0, 1fr); } }
/* Notifications: top, horizontally centered (the top offset per layout comes from sileo_tags) */
#sileo-root [data-sileo-viewport] { left: 50% !important; right: auto !important; transform: translateX(-50%); align-items: center; }
#sileo-root [data-sileo-toast] { margin-left: auto; margin-right: auto; }
