
  /* ===== ACCESS USERS ===== */
  body.access-page-active { overflow: hidden; }
  body.access-page-active .crm,
  body.access-page-active .main { height: 100dvh; min-height: 0; overflow: hidden; }
  #page-access.active {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  #page-access.active > .page-header { position: sticky; z-index: 9; left: 0; flex: 0 0 auto; }
  .access-page-tabs { display: flex; width: max-content; gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid #e1e4e9; border-radius: 10px; background: #f4f6f8; }
  .access-page-tab { padding: 8px 13px; border: 0; border-radius: 7px; background: transparent; color: #737985; font: inherit; font-size: 11px; font-weight: 720; cursor: pointer; }
  .access-page-tab.active { background: #fff; color: #248d81; box-shadow: 0 1px 5px rgba(20,24,34,.1); }
  .access-ai-connections { min-width: 980px; padding: 18px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
  .access-ai-connections[hidden] { display: none; }
  .access-ai-connections-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
  .access-ai-connections-head h2 { margin: 0; color: #2d3038; font-size: 16px; }
  .access-ai-connections-head p { max-width: 700px; margin: 5px 0 0; color: #7b818c; font-size: 11px; line-height: 1.5; }
  .access-ai-refresh { padding: 7px 11px; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; color: #555b66; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
  .access-ai-note { margin: 14px 0; padding: 9px 11px; border-radius: 8px; background: #f5f3ff; color: #6553be; font-size: 10px; line-height: 1.45; }
  .access-ai-research-settings { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--crm-border); border-radius: var(--crm-panel-radius); background: var(--crm-surface-soft); color: var(--crm-text); }
  .access-ai-research-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
  .access-ai-research-heading h3 { margin: 0; font-size: 13px; }
  .access-ai-research-heading p { max-width: 720px; margin: 4px 0 0; color: var(--crm-muted); font-size: 10px; line-height: 1.45; }
  .access-ai-research-heading>span { color: var(--crm-muted); font-size: 9px; white-space: nowrap; }
  .access-ai-research-heading>span[data-error="true"] { color: #c04b42; }
  .access-ai-research-grid { display: grid; grid-template-columns: 1.4fr 1.4fr repeat(3,minmax(118px,.7fr)); gap: 10px; }
  .access-ai-research-grid fieldset { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; margin: 0; padding: 9px; border: 1px solid var(--crm-border); border-radius: var(--crm-control-radius); }
  .access-ai-research-grid legend,.access-ai-research-number,.access-ai-research-instructions { color: var(--crm-muted); font-size: 9px; font-weight: 700; }
  .access-ai-research-grid fieldset label,.access-ai-research-sources label { display: inline-flex; align-items: center; gap: 5px; color: var(--crm-text); font-size: 9px; font-weight: 620; }
  .access-ai-research-grid input[type="radio"],.access-ai-research-sources input { accent-color: var(--crm-accent); }
  .access-ai-research-number { display: grid; align-content: start; gap: 6px; }
  .access-ai-research-number input,.access-ai-research-instructions textarea { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--crm-border-strong); border-radius: var(--crm-control-radius); outline: 0; background: var(--crm-surface-solid); color: var(--crm-text); font: inherit; }
  .access-ai-research-number input:focus,.access-ai-research-instructions textarea:focus { border-color: var(--crm-accent); box-shadow: var(--crm-focus-ring); }
  .access-ai-research-sources { display: flex; flex-wrap: wrap; gap: 12px; }
  .access-ai-research-instructions { display: grid; gap: 6px; }
  .access-ai-research-instructions textarea { min-height: 62px; resize: vertical; line-height: 1.45; }
  .access-ai-research-actions { display: flex; justify-content: flex-end; gap: 7px; }
  .access-ai-research-save { padding: 7px 11px; border: 1px solid var(--crm-accent); border-radius: 8px; background: var(--crm-accent); color: #fff; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
  .access-ai-research-save:disabled { opacity: .55; cursor: default; }
  .access-ai-table-wrap { overflow: hidden; border: 1px solid #e7e9ed; border-radius: 10px; }
  .access-ai-table { width: 100%; border-collapse: collapse; }
  .access-ai-table th { padding: 10px; background: #f7f8fa; color: #7c808b; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
  .access-ai-table td { padding: 11px 10px; border-top: 1px solid #eceef1; color: #3b3f48; font-size: 11px; }
  .access-ai-table td strong, .access-ai-table td small { display: block; }
  .access-ai-table td small { margin-top: 2px; color: #969aa5; font-size: 9px; }
  .access-ai-badge { display: inline-flex; padding: 5px 7px; border-radius: 7px; background: #f0f1f3; color: #7d828c; font-size: 9px; font-weight: 720; }
  .access-ai-badge.enabled, .access-ai-badge.connected { background: #e9f7f4; color: #248d81; }
  .access-ai-badge.connecting { background: #fff5de; color: #a36b00; }
  .access-ai-badge.inactive { background: #fff0ef; color: #c04b42; }
  .access-ai-toggle { display: inline-flex; align-items: center; gap: 7px; color: #5f6570; font-size: 10px; font-weight: 650; cursor: pointer; }
  .access-ai-toggle input { width: 17px; height: 17px; margin: 0; accent-color: #43b7a8; }
  .access-ai-disconnect { padding: 6px 8px; border: 1px solid #e1c9c6; border-radius: 7px; background: #fff; color: #bd5148; font: inherit; font-size: 9px; font-weight: 680; cursor: pointer; }
  .access-ai-disconnect:disabled { cursor: default; opacity: .42; }
  .access-ai-actions { display: flex; flex-wrap: wrap; gap: 5px; }
  .access-ai-note code { user-select: all; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
  .access-table-wrap { position: relative; isolation: isolate; width: max-content; min-width: 100%; flex: 0 0 auto; overflow: visible; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
  #page-access .access-table { width: 100%; min-width: 1760px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
  .access-table thead { position: static; }
  .access-table th { position: sticky; z-index: 7; top: 0; padding: 11px 10px; border-bottom: 1px solid #e8e9ed; background: #f7f8fa; box-shadow: 0 8px 16px -16px rgba(20,22,28,.92); color: #7c808b; font-size: 9px; font-weight: 750; line-height: 1.25; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
  .access-column-head { display: flex; align-items: center; justify-content: flex-start; gap: 4px; }
  .access-table th.permission-column .access-column-head { justify-content: center; }
  .access-filter-trigger,
  .access-sort-trigger { border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
  .access-filter-trigger { padding: 3px 2px; line-height: 1.25; text-align: inherit; }
  .access-filter-trigger:hover,
  .access-filter-trigger.active { color: #2f9f91; }
  .access-sort-trigger { display: inline-flex; width: 19px; height: 19px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 5px; color: #9da1aa; font-size: 12px; line-height: 1; }
  .access-sort-trigger:hover,
  .access-sort-trigger.active { background: rgba(67,183,168,.12); color: #2f9f91; }
  .access-filter-popover { position: fixed; z-index: 120; display: none; width: min(330px,calc(100vw - 24px)); padding: 12px; border: 1px solid #dfe2e8; border-radius: 12px; background: #fff; box-shadow: 0 18px 48px rgba(20,22,28,.2); color: #333; text-transform: none; letter-spacing: normal; }
  .access-filter-popover.open { display: block; }
  .access-filter-title { margin-bottom: 9px; color: #777c87; font-size: 10px; font-weight: 720; }
  .access-filter-options { display: flex; max-height: 260px; flex-direction: column; gap: 4px; overflow: auto; }
  .access-filter-option { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
  .access-filter-option:hover { background: #f3f5f7; }
  .access-filter-option input { width: 16px; height: 16px; margin: 0; accent-color: #43b7a8; }
  .access-filter-option-label { min-width: 0; overflow: hidden; color: #333; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .access-filter-option-count { color: #8f94a0; font-size: 10px; font-weight: 650; }
  .access-filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eceef1; }
  .access-filter-action { padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #777c87; font-size: 10px; font-weight: 680; cursor: pointer; }
  .access-filter-action:hover { background: #f3f5f7; }
  .access-filter-action.primary { background: #43b7a8; color: #fff; }
  .access-filter-action.primary:hover { background: #329f92; }
  .access-table th.permission-column,
  .access-table td.permission-column { width: 120px; min-width: 120px; text-align: center; }
  .access-table td { padding: 11px 10px; border-bottom: 1px solid #eceef1; color: #333; font-size: 11px; vertical-align: middle; }
  .access-table th:first-child,
  .access-table td:first-child { position: sticky; left: 0; width: 310px; min-width: 310px; }
  .access-table th:nth-child(2),
  .access-table td:nth-child(2) { width: 190px; min-width: 190px; }
  .access-table th:nth-child(3),
  .access-table td:nth-child(3) { width: 180px; min-width: 180px; }
  .access-table th:last-child,
  .access-table td:last-child { width: 120px; min-width: 120px; }
  .access-table th:first-child { z-index: 8; background: #f7f8fa; box-shadow: 10px 0 18px -13px rgba(20,22,28,.72); }
  .access-table td:first-child { z-index: 4; background: #fff; box-shadow: 10px 0 18px -13px rgba(20,22,28,.64); }
  .access-table tbody tr:last-child td { border-bottom: 0; }
  .access-table tbody tr:hover { background: #fafbfc; }
  .access-table tbody tr:hover td:first-child { background: #fafbfc; }
  .access-user { display: flex; width: 100%; min-width: 0; align-items: center; gap: 10px; overflow: hidden; }
  .access-avatar { display: flex; width: 34px; height: 34px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: #eceef3; color: #5f6470; font: inherit; font-size: 10px; font-weight: 750; }
  button.access-avatar:not(:disabled) { cursor: pointer; box-shadow: 0 0 0 0 rgba(67,183,168,0); transition: box-shadow .15s ease,transform .15s ease; }
  button.access-avatar:not(:disabled):hover { box-shadow: 0 0 0 3px rgba(67,183,168,.24); transform: scale(1.04); }
  button.access-avatar:not(:disabled):focus-visible { outline: 3px solid rgba(67,183,168,.34); outline-offset: 2px; }
  button.access-avatar.loading { cursor: wait; opacity: .58; }
  .access-identity-fields { min-width: 0; flex: 1; }
  .access-user-name { font-size: 12px; font-weight: 700; }
  .access-user-email { margin-top: 2px; color: #969aa5; font-size: 9px; }
  .access-user-name-input,
  .access-user-contact-input,
  .access-skill-input { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 6px; outline: none; background: transparent; color: inherit; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
  .access-user-name-input { padding: 3px 5px; font: inherit; font-size: 12px; font-weight: 700; }
  .access-user-contact-input { min-width: 0; flex: 1; padding: 2px 4px; color: #969aa5; font: inherit; font-size: 9px; }
  .access-skill-input { min-width: 116px; padding: 6px 8px; background: #eef5f4; color: #298f82; font: inherit; font-size: 10px; font-weight: 680; }
  .access-user-name-input:hover,
  .access-user-contact-input:hover,
  .access-skill-input:hover { border-color: #d6dae2; }
  .access-user-name-input:focus,
  .access-user-contact-input:focus,
  .access-skill-input:focus { border-color: #43b7a8; background: #fff; box-shadow: 0 0 0 2px rgba(67,183,168,.12); }
  .access-user-name-input::placeholder,
  .access-user-contact-input::placeholder,
  .access-skill-input::placeholder { color: #a4a8b1; font-weight: 500; }
  .access-user-name-input:disabled,
  .access-user-contact-input:disabled,
  .access-skill-input:disabled { cursor: default; border-color: transparent; opacity: .72; box-shadow: none; }
  .access-login-row,
  .access-password-row { display: flex; min-width: 0; align-items: center; gap: 3px; }
  .access-password-row[hidden] { display: none; }
  .access-login-row { margin-top: 1px; }
  .access-password-row { margin-top: 1px; }
  .access-field-label { flex: 0 0 auto; color: #8f94a0; font-size: 9px; font-weight: 650; }
  .access-password-input { width: 82px; min-width: 0; padding: 2px 4px; border: 1px solid transparent; border-radius: 6px; outline: none; background: transparent; color: #969aa5; font: inherit; font-size: 9px; letter-spacing: .08em; transition: width .15s ease, color .15s ease; }
  .access-password-input.revealed { width: 118px; color: #4d5360; letter-spacing: 0; }
  .access-password-input:focus { border-color: #43b7a8; background: #fff; box-shadow: 0 0 0 2px rgba(67,183,168,.12); }
  .access-password-input.access-password-saved { border-color: rgba(67,183,168,.55); background: rgba(67,183,168,.09); color: #298f82; }
  .access-password-toggle { display: inline-flex; width: 22px; height: 20px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #8f94a0; cursor: pointer; }
  .access-password-toggle:hover,
  .access-password-toggle.active { background: rgba(67,183,168,.12); color: #43b7a8; }
  .access-eye-icon { position: relative; display: block; width: 13px; height: 8px; border: 1.5px solid currentColor; border-radius: 50%; }
  .access-eye-icon::after { position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: currentColor; content: ''; transform: translate(-50%,-50%); }
  .access-role-cell { min-width: 0; overflow: visible; }
  .access-role-control { display: flex; min-width: 0; align-items: center; gap: 6px; }
  .access-role-select { width: 100%; min-width: 0; max-width: 100%; flex: 1; padding: 7px 9px; border: 1px solid #dfe2e8; border-radius: 8px; background: #fff; color: #333; font: inherit; cursor: pointer; }
  .access-role-select:disabled { cursor: default; opacity: 1; color: #6553be; font-weight: 700; }
  .access-role-select.access-role-native { display: none; }
  .access-role-picker { position: relative; width: 100%; min-width: 0; max-width: 100%; flex: 1; }
  .access-role-trigger { display: flex; width: 100%; min-width: 0; max-width: 100%; min-height: 34px; align-items: center; justify-content: space-between; gap: 10px; overflow: hidden; padding: 7px 10px; border: 1px solid #dfe2e8; border-radius: 8px; background: #fff; color: #333; font: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
  .access-role-trigger::after { color: #8f94a0; content: '⌄'; font-size: 13px; }
  .access-role-trigger:hover,
  .access-role-trigger[aria-expanded="true"] { border-color: #43b7a8; }
  .access-role-trigger:disabled { cursor: default; opacity: .68; }
  [data-access-user][data-profile-confirmed="0"] .access-role-select,
  [data-access-user][data-profile-confirmed="0"] .access-role-trigger,
  [data-access-user][data-profile-confirmed="0"] .access-skill-input { border-color: #dfe2e8; background: #fff; color: #333; }
  [data-access-user][data-profile-confirmed="0"] .access-role-select:disabled,
  [data-access-user][data-profile-confirmed="0"] .access-role-trigger:disabled { opacity: 1; color: #333; }
  [data-access-user][data-profile-confirmed="1"] .access-role-select,
  [data-access-user][data-profile-confirmed="1"] .access-role-trigger,
  [data-access-user][data-profile-confirmed="1"] .access-skill-input { border-color: rgba(67,183,168,.28); background: #eef5f4; color: #298f82; font-weight: 700; }
  [data-access-user][data-profile-confirmed="1"] .access-role-select:disabled,
  [data-access-user][data-profile-confirmed="1"] .access-role-trigger:disabled { opacity: 1; color: #298f82; }
  .access-role-menu { position: absolute; z-index: 35; top: calc(100% + 5px); left: 0; width: max(100%, 230px); max-height: 280px; overflow-y: auto; padding: 6px; border: 1px solid #dfe2e8; border-radius: 9px; background: #fff; box-shadow: 0 14px 34px rgba(20,24,34,.18); }
  .access-role-menu[hidden] { display: none; }
  .access-role-menu-item { display: flex; align-items: center; gap: 4px; border-radius: 7px; }
  .access-role-menu-item:hover { background: #f3f5f7; }
  .access-role-menu-choice { min-width: 0; flex: 1; padding: 8px 9px; border: 0; background: transparent; color: #333; font: inherit; text-align: left; cursor: pointer; }
  .access-role-menu-choice:disabled { cursor: default; opacity: .55; }
  .access-role-menu-item.selected .access-role-menu-choice { color: #2f9f91; font-weight: 750; }
  .access-role-delete { display: inline-flex; width: 27px; height: 27px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #dc5047; cursor: pointer; }
  .access-role-delete:hover { background: #fff1ef; }
  .access-role-delete-icon { position: relative; width: 12px; height: 14px; border: 1.7px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; }
  .access-role-delete-icon::before { position: absolute; top: -4px; left: -2px; width: 13px; height: 1.7px; border-radius: 2px; background: currentColor; content: ''; }
  .access-role-delete-icon::after { position: absolute; top: -7px; left: 3px; width: 5px; height: 3px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; content: ''; }
  .access-role-menu-divider { height: 1px; margin: 5px 4px; background: #eceef1; }
  .access-role-menu-new { display: flex; width: 100%; align-items: center; gap: 6px; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: #2f9f91; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
  .access-role-menu-new:hover { background: rgba(67,183,168,.1); }
  .access-new-role-editor { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; gap: 5px; min-width: 258px; margin-top: 7px; padding: 7px; border: 1px solid #dfe2e8; border-radius: 9px; background: #fff; box-shadow: 0 8px 24px rgba(20,24,34,.12); }
  .access-new-role-input { min-width: 0; padding: 7px 9px; border: 1px solid #d6dae2; border-radius: 7px; outline: none; background: #fff; color: #24262d; font: inherit; }
  .access-new-role-input:focus { border-color: #43b7a8; box-shadow: 0 0 0 2px rgba(67,183,168,.13); }
  .access-new-role-action { padding: 7px 9px; border: 1px solid #d6dae2; border-radius: 7px; background: #f6f7f9; color: #5d626d; font: inherit; font-weight: 700; cursor: pointer; }
  .access-new-role-action.primary { border-color: #43b7a8; background: #43b7a8; color: #fff; }
  .access-new-role-action:hover { filter: brightness(.97); }
  .access-skill-chip { display: inline-flex; max-width: 100%; overflow: hidden; padding: 5px 8px; border-radius: 7px; background: #eef5f4; color: #298f82; font-size: 10px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
  .access-permission { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .access-permission input { width: 18px; height: 18px; margin: 0; accent-color: #43b7a8; cursor: pointer; }
  .access-permission input:disabled { cursor: default; opacity: .8; }
  .access-delete-user { padding: 6px 9px; border: 1px solid #efc8c4; border-radius: 8px; background: transparent; color: #d75a4e; font-size: 10px; font-weight: 650; cursor: pointer; }
  .access-delete-user:hover { background: #fff1ef; }
  .access-admin-badge { display: inline-flex; padding: 5px 8px; border-radius: 7px; background: #f0edff; color: #6553be; font-size: 9px; font-weight: 720; white-space: nowrap; }
  .access-user-new { background: rgba(67,183,168,.07); }
  .access-user-new td { border-top: 1px solid rgba(67,183,168,.35); }
  .access-user-new td:first-child { background: #f4fbfa; }
  .crm-permission-notice { position: fixed; z-index: 120; top: 20px; left: 50%; display: flex; width: min(470px, calc(100vw - 32px)); min-height: 54px; padding: 13px 16px; align-items: center; gap: 11px; border: 1px solid rgba(231,76,60,.46); border-radius: 12px; background: #fff5f4; color: #b83d34; box-shadow: 0 18px 46px rgba(18,20,26,.22); font-size: 12px; font-weight: 700; line-height: 1.4; opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: opacity .18s ease, transform .18s ease; }
  .crm-permission-notice::before { content: "!"; display: inline-flex; width: 25px; height: 25px; flex: 0 0 25px; align-items: center; justify-content: center; border-radius: 50%; background: #e74c3c; color: #fff; font-size: 14px; font-weight: 800; }
  .crm-permission-notice.success { border-color: rgba(67,183,168,.46); background: #effaf7; color: #237f73; }
  .crm-permission-notice.success::before { background: #43b7a8; content: "✓"; }
  .crm-permission-notice.visible { opacity: 1; transform: translate(-50%, 0); }
  .financial-data-restricted .crm-financial-value { filter: blur(7px); user-select: none; pointer-events: none; }
