@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    /* نفس ألوان هوية HUNT ERP بالظبط — المصدر: public/css/brand-theme.css */
    --hunt-blue: #0c4a8c;        /* brand-primary */
    --hunt-blue-dark: #093968;   /* brand-primary-hover */
    --hunt-blue-ink: #062c55;
    --hunt-blue-light: #2563a8;  /* brand-primary-light */
    --hunt-teal: #5eb3a6;        /* brand-secondary */
    --hunt-teal-dark: #4a9389;   /* brand-secondary-hover */
    --hunt-teal-light: #7dc4b9;  /* brand-secondary-light */
    --hunt-bg: #f3f4f6;          /* نفس خلفية صفحات الـERP (global.css --background) */
    --hunt-surface: #ffffff;
    --hunt-text: #111418;        /* brand-text — أغمق للقراءة */
    --hunt-muted: #495057;       /* brand-text-muted — أغمق */
    --hunt-border: #e5e7eb;      /* brand-border */
    --hunt-shadow: 0 12px 34px rgba(21, 54, 91, .09);
    --crm-sidebar-collapsed-width: 84px;
    --crm-sidebar-expanded-width: 248px;
    --crm-dock-height: 72px;
    --crm-sidebar-width: var(--crm-sidebar-collapsed-width);
}

* {
    box-sizing: border-box;
}

.crm-portal-body,
.crm-login-body {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    margin: 0;
}

/* Standalone CRM app shell */
.crm-portal-body {
    background: var(--hunt-bg);
    color: var(--hunt-text);
    min-height: 100vh;
}

.crm-app-sidebar {
    background: var(--hunt-blue);
    bottom: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    inset-inline-start: 0;
    box-shadow: 0 0 0 rgba(4, 31, 61, 0);
    overflow: hidden;
    padding: 16px 12px 13px;
    position: fixed;
    top: 0;
    width: var(--crm-sidebar-width);
    z-index: 1040;
    transition: width .24s ease, box-shadow .24s ease;
}

.crm-app-sidebar:hover,
.crm-app-sidebar:focus-within {
    box-shadow: -18px 0 42px rgba(4, 31, 61, .18);
    width: var(--crm-sidebar-expanded-width);
}

.crm-app-brand {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .13);
    display: flex;
    flex-direction: column;
    min-height: 84px;
    overflow: hidden;
    justify-content: flex-start;
    padding: 3px 7px 16px;
    transition: min-height .24s ease, padding .24s ease;
}

.crm-app-brand > img {
    background: #fff;
    border-radius: 9px;
    display: block;
    height: 54px;
    max-width: 154px;
    object-fit: contain;
    padding: 7px;
    width: 43px;
    transition: width .24s ease;
}

.crm-app-brand__tag {
    background: var(--hunt-teal);
    border-radius: 5px;
    display: inline-block;
    font-size: .68rem;
    font-weight: 800;
    margin-top: 8px;
    padding: 3px 8px;
    transition: opacity .15s ease, max-width .2s ease, margin .2s ease, padding .2s ease;
}

.crm-app-brand p {
    color: rgba(255, 255, 255, .65);
    font-size: .68rem;
    line-height: 1.6;
    margin: 11px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity .15s ease, max-width .2s ease, margin .2s ease;
}

.crm-wordmark {
    align-items: center;
    direction: ltr;
    display: flex;
    gap: 8px;
    width: fit-content;
}

.crm-app-sidebar .crm-wordmark {
    gap: 0;
    transition: gap .2s ease;
}

.crm-wordmark__mark {
    align-items: center;
    border: 2px solid #4ca2dc;
    border-radius: 50%;
    color: #6ab7e8;
    display: inline-flex;
    font-size: 1.35rem;
    font-weight: 800;
    height: 43px;
    justify-content: center;
    transform: rotate(-9deg);
    width: 43px;
}

.crm-wordmark__name {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .035em;
    transition: opacity .15s ease, max-width .2s ease;
}

.crm-wordmark__tag {
    background: var(--hunt-teal);
    border-radius: 5px;
    color: #fff;
    font-size: .72rem;
    font-style: normal;
    font-weight: 800;
    padding: 4px 7px;
    transition: opacity .15s ease, max-width .2s ease, padding .2s ease;
}

.crm-app-navigation {
    display: grid;
    flex: 1;
    gap: 4px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 0;
    scrollbar-width: none;
}

.crm-app-navigation::-webkit-scrollbar {
    display: none;
}

.crm-app-navigation__section {
    align-items: center;
    color: rgba(255, 255, 255, .42);
    display: flex;
    font-size: .63rem;
    font-weight: 700;
    gap: 0;
    letter-spacing: .02em;
    justify-content: center;
    margin: 10px 5px 5px;
    min-height: 16px;
    overflow: hidden;
}

.crm-app-navigation__section::after {
    background: rgba(255, 255, 255, .13);
    content: '';
    flex: 0 0 24px;
    height: 1px;
}

.crm-app-navigation__item {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    color: rgba(255, 255, 255, .76);
    display: flex;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    gap: 0;
    justify-content: center;
    height: 46px;
    margin-inline: auto;
    min-height: 46px;
    overflow: hidden;
    padding: 10px;
    position: relative;
    text-align: start;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, gap .2s ease, transform .18s ease, width .2s ease;
    width: 48px;
}

.crm-app-navigation__item i {
    align-items: center;
    display: inline-flex;
    flex: 0 0 22px;
    font-size: 1.05rem;
    height: 22px;
    justify-content: center;
    line-height: 1;
    text-align: center;
    width: 22px;
}

.crm-app-navigation__item > span,
.crm-app-navigation__section > span,
.crm-app-brand p,
.crm-app-brand > .crm-app-brand__tag,
.crm-app-sidebar .crm-wordmark__name,
.crm-app-sidebar .crm-wordmark__tag,
.crm-sidebar-account__copy,
.crm-sidebar-account__arrow {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(5px);
    white-space: nowrap;
}

.crm-app-sidebar:hover .crm-app-brand,
.crm-app-sidebar:focus-within .crm-app-brand {
    align-items: flex-start;
    min-height: 104px;
    padding: 0 8px 18px;
}

.crm-app-sidebar:hover .crm-app-brand > img,
.crm-app-sidebar:focus-within .crm-app-brand > img {
    width: 154px;
}

.crm-app-sidebar:hover .crm-wordmark,
.crm-app-sidebar:focus-within .crm-wordmark {
    gap: 8px;
}

.crm-app-sidebar:hover .crm-app-navigation__item,
.crm-app-sidebar:focus-within .crm-app-navigation__item {
    gap: 12px;
    justify-content: flex-start;
    padding-inline: 13px;
    width: 100%;
}

.crm-app-sidebar:hover .crm-app-navigation__section,
.crm-app-sidebar:focus-within .crm-app-navigation__section {
    gap: 10px;
    justify-content: flex-start;
    margin-inline: 12px;
}

.crm-app-sidebar:hover .crm-app-navigation__section::after,
.crm-app-sidebar:focus-within .crm-app-navigation__section::after {
    flex: 1;
}

.crm-app-sidebar:hover .crm-app-navigation__item > span,
.crm-app-sidebar:focus-within .crm-app-navigation__item > span,
.crm-app-sidebar:hover .crm-app-navigation__section > span,
.crm-app-sidebar:focus-within .crm-app-navigation__section > span,
.crm-app-sidebar:hover .crm-app-brand p,
.crm-app-sidebar:focus-within .crm-app-brand p,
.crm-app-sidebar:hover .crm-app-brand > .crm-app-brand__tag,
.crm-app-sidebar:focus-within .crm-app-brand > .crm-app-brand__tag,
.crm-app-sidebar:hover .crm-wordmark__name,
.crm-app-sidebar:focus-within .crm-wordmark__name,
.crm-app-sidebar:hover .crm-wordmark__tag,
.crm-app-sidebar:focus-within .crm-wordmark__tag,
.crm-app-sidebar:hover .crm-sidebar-account__copy,
.crm-app-sidebar:focus-within .crm-sidebar-account__copy,
.crm-app-sidebar:hover .crm-sidebar-account__arrow,
.crm-app-sidebar:focus-within .crm-sidebar-account__arrow {
    max-width: 180px;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.crm-app-navigation__item:hover,
.crm-app-navigation__item:focus-visible {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .08);
    color: #fff;
    outline: none;
}

.crm-app-navigation__item.is-active {
    background: var(--hunt-teal);
    border-color: rgba(255, 255, 255, .22);
    box-shadow: 0 8px 18px rgba(3, 31, 65, .24), inset 0 1px 0 rgba(255, 255, 255, .14);
    color: #fff;
}

.crm-app-navigation__item.is-active::after {
    background: #c8f1f2;
    border-radius: 999px;
    content: '';
    height: 18px;
    inset-inline-end: 3px;
    position: absolute;
    width: 3px;
}

.crm-app-sidebar__footer {
    border-top: 1px solid rgba(255, 255, 255, .13);
    display: grid;
    flex: 0 0 auto;
    gap: 3px;
    margin-top: auto;
    padding-top: 11px;
}

.crm-app-sidebar__footer form {
    margin: 0;
}

.crm-sidebar-account {
    align-items: center;
    border-radius: 9px;
    color: #fff;
    display: flex;
    gap: 0;
    justify-content: center;
    margin-bottom: 7px;
    margin-inline: auto;
    min-height: 48px;
    overflow: hidden;
    padding: 4px;
    text-decoration: none;
    transition: background-color .18s ease, gap .2s ease, width .2s ease;
    width: 48px;
}

.crm-sidebar-account:hover,
.crm-sidebar-account:focus-visible,
.crm-sidebar-account.is-active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    outline: none;
}

.crm-sidebar-account__avatar {
    align-items: center;
    background: linear-gradient(145deg, #62bbc1, var(--hunt-teal-dark));
    border: 2px solid rgba(255, 255, 255, .28);
    border-radius: 11px;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: .82rem;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.crm-sidebar-account__copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    line-height: 1.45;
    transition: opacity .15s ease, max-width .2s ease, transform .2s ease;
}

.crm-sidebar-account__copy strong {
    font-size: .7rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-sidebar-account__copy small {
    color: rgba(255, 255, 255, .58);
    font-size: .58rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-sidebar-account__arrow {
    color: rgba(255, 255, 255, .45);
    font-size: .65rem;
    transition: opacity .15s ease, max-width .2s ease, transform .2s ease;
}

.crm-app-navigation__button {
    cursor: pointer;
}

.crm-app-sidebar:hover .crm-sidebar-account,
.crm-app-sidebar:focus-within .crm-sidebar-account {
    gap: 10px;
    justify-content: flex-start;
    padding-inline: 4px 10px;
    width: 100%;
}

.crm-app-main {
    display: flex;
    flex-direction: column;
    margin-inline-start: var(--crm-sidebar-width);
    min-height: 100vh;
    transition: margin .24s ease;
}

.crm-app-topbar {
    align-items: center;
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid var(--hunt-border);
    display: flex;
    height: 72px;
    justify-content: space-between;
    padding: 0 clamp(18px, 3vw, 42px);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.crm-app-topbar__identity,
.crm-app-topbar__context,
.crm-app-topbar__actions {
    align-items: center;
    display: flex;
}

.crm-app-topbar__actions {
    gap: 14px;
}

.crm-topbar-notification {
    align-items: center;
    background: #f4f8fc;
    border: 1px solid var(--hunt-border);
    border-radius: 9px;
    color: var(--hunt-blue-ink);
    display: inline-flex;
    height: 39px;
    justify-content: center;
    position: relative;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease;
    width: 39px;
}

.crm-topbar-notification:hover,
.crm-topbar-notification:focus-visible {
    background: #edf7f8;
    border-color: #b8dfe2;
    color: var(--hunt-teal-dark);
    outline: none;
}

.crm-topbar-notification span {
    align-items: center;
    background: #ef6f6c;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .5rem;
    font-weight: 800;
    height: 17px;
    inset-inline-end: -5px;
    justify-content: center;
    min-width: 17px;
    padding: 0 3px;
    position: absolute;
    top: -5px;
}

.crm-app-topbar__identity {
    gap: 12px;
}

.crm-app-topbar__identity div {
    display: flex;
    flex-direction: column;
    line-height: 1.45;
}

.crm-app-topbar__identity span {
    color: var(--hunt-muted);
    font-size: .65rem;
}

.crm-app-topbar__identity strong {
    color: var(--hunt-blue-ink);
    font-size: .78rem;
}

.crm-app-topbar__context {
    color: var(--hunt-muted);
    font-size: .72rem;
    font-weight: 700;
    gap: 8px;
}

.crm-app-status-dot {
    background: #22a06b;
    border: 3px solid #d9f4e8;
    border-radius: 50%;
    height: 12px;
    width: 12px;
}

.crm-app-menu-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 8px;
    color: var(--hunt-blue-ink);
    cursor: pointer;
    display: none;
    height: 39px;
    justify-content: center;
    width: 39px;
}

.crm-app-content {
    flex: 1;
    padding: clamp(20px, 3vw, 40px);
    padding-bottom: calc(clamp(20px, 3vw, 40px) + var(--crm-dock-height));
}

.crm-app-container {
    margin: 0 auto;
    max-width: 1540px;
}

.crm-app-footer {
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid #d6e1ec;
    bottom: 0;
    box-shadow: 0 -10px 32px rgba(21, 54, 91, .11);
    color: var(--hunt-blue-ink);
    height: var(--crm-dock-height);
    inset-inline-end: 0;
    inset-inline-start: var(--crm-sidebar-width);
    position: fixed;
    z-index: 1030;
}

.crm-app-footer__inner {
    align-items: center;
    display: flex;
    gap: 24px;
    height: 100%;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1540px;
    padding: 7px clamp(18px, 2.4vw, 34px);
}

.crm-app-footer__brand {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

.crm-app-footer__brand-mark {
    align-items: center;
    background: #eaf3fb;
    border: 1px solid #c8deee;
    border-radius: 10px;
    color: var(--hunt-blue);
    display: inline-flex;
    flex: 0 0 38px;
    font-size: .95rem;
    font-weight: 800;
    height: 38px;
    justify-content: center;
}

.crm-app-footer__brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

.crm-app-footer__brand-copy strong {
    color: var(--hunt-blue-ink);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.crm-app-footer__brand-copy small {
    align-items: center;
    color: #5d6d81;
    display: inline-flex;
    font-size: .54rem;
    gap: 5px;
}

.crm-app-footer__brand-copy small i {
    background: #25a675;
    border: 2px solid #d9f4e8;
    border-radius: 50%;
    height: 8px;
    width: 8px;
}

.crm-app-footer__options {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 5px;
    height: 100%;
    justify-content: center;
}

.crm-app-footer__options > a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #66758b;
    display: flex;
    gap: 8px;
    height: 52px;
    justify-content: center;
    min-width: 104px;
    padding: 6px 11px;
    position: relative;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.crm-app-footer__options > a:hover,
.crm-app-footer__options > a:focus-visible {
    background: #f1f7fb;
    border-color: #d9e7f1;
    color: var(--hunt-blue);
    outline: none;
    transform: translateY(-1px);
}

.crm-app-footer__options > a.is-active {
    background: #eaf7f6;
    border-color: #c7e7e5;
    color: var(--hunt-teal-dark);
}

.crm-app-footer__icon {
    align-items: center;
    background: #f2f6fa;
    border: 1px solid #e2e9f0;
    border-radius: 8px;
    color: currentColor;
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
}

.crm-app-footer__options > a.is-active .crm-app-footer__icon {
    background: #dff2f0;
    border-color: #bde2df;
}

.crm-app-footer__label {
    font-size: .62rem;
    font-weight: 800;
    white-space: nowrap;
}

.crm-app-footer__options > a > b {
    align-items: center;
    background: #ef6f6c;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .48rem;
    font-weight: 800;
    height: 17px;
    inset-inline-start: 3px;
    justify-content: center;
    min-width: 17px;
    padding: 0 3px;
    position: absolute;
    top: 2px;
}

.crm-app-footer__copyright {
    color: #8190a2;
    flex: 0 0 auto;
    font-size: .52rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-app-overlay {
    background: rgba(6, 31, 61, .54);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 1035;
}

/* CRM administration surfaces: Meta, users and permissions */
.crm-admin-page {
    color: var(--hunt-text);
    display: grid;
    gap: 22px;
}

.crm-admin-head {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.crm-admin-head h1 {
    color: var(--hunt-blue-ink);
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
}

.crm-admin-head p,
.crm-admin-panel__head p {
    color: var(--hunt-muted);
    font-size: .74rem;
    line-height: 1.7;
    margin: 5px 0 0;
}

.crm-admin-head__actions,
.crm-admin-panel__head,
.crm-user-cell,
.crm-row-actions,
.crm-panel-savebar,
.crm-form-actions {
    align-items: center;
    display: flex;
}

.crm-status-chip,
.crm-event-status,
.crm-role-chip {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-size: .67rem;
    font-weight: 700;
    gap: 7px;
    padding: 6px 10px;
    white-space: nowrap;
}

.crm-status-chip i {
    background: currentColor;
    border-radius: 50%;
    height: 7px;
    width: 7px;
}

.crm-status-chip.is-online,
.crm-event-status.is-processed {
    background: #e8f7ef;
    color: #19724d;
}

.crm-status-chip.is-muted,
.crm-event-status.is-received {
    background: #eef2f6;
    color: #64748b;
}

.crm-event-status.is-failed {
    background: #fff0f0;
    color: #c43838;
}

.crm-event-status.is-duplicate {
    background: #fff7e8;
    color: #a96700;
}

.crm-admin-button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: .72rem;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
}

.crm-admin-button:hover {
    transform: translateY(-1px);
}

.crm-admin-button.is-primary {
    background: var(--hunt-teal-dark);
    box-shadow: 0 7px 16px rgba(49, 139, 148, .16);
    color: #fff;
}

.crm-admin-button.is-primary:hover {
    background: #247a83;
    color: #fff;
}

.crm-admin-button.is-secondary {
    background: #fff;
    border-color: #b9c9d9;
    color: var(--hunt-blue);
}

.crm-admin-button.is-quiet {
    background: #eaf5f6;
    color: var(--hunt-teal-dark);
    min-height: 36px;
    padding: 7px 12px;
}

.crm-admin-panel {
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 9px;
    box-shadow: 0 4px 16px rgba(18, 47, 80, .045);
    min-width: 0;
}

.crm-admin-panel__head {
    border-bottom: 1px solid var(--hunt-border);
    gap: 16px;
    justify-content: space-between;
    min-height: 76px;
    padding: 17px 21px;
}

.crm-admin-panel__head h2 {
    color: var(--hunt-blue-ink);
    font-size: .92rem;
    font-weight: 800;
    margin: 0;
}

.crm-meta-config-grid {
    direction: ltr;
    display: grid;
    gap: 14px;
    grid-template-columns: 245px minmax(0, 1fr);
}

.crm-meta-config-grid > * {
    direction: rtl;
}

.crm-meta-connection-card {
    align-items: center;
    display: flex;
    flex-direction: column;
    min-height: 350px;
    padding: 23px 20px 19px;
    text-align: center;
}

.crm-meta-mark {
    color: #0866ff;
    font-family: Arial, sans-serif;
    font-size: 5.2rem;
    font-weight: 700;
    height: 93px;
    line-height: .85;
}

.crm-meta-connection-card > strong {
    color: #19724d;
    font-size: .86rem;
}

.crm-meta-connection-card > p {
    color: var(--hunt-muted);
    font-size: .67rem;
    margin: 5px 0 20px;
}

.crm-meta-connection-line {
    border-top: 1px solid var(--hunt-border);
    display: flex;
    font-size: .66rem;
    justify-content: space-between;
    padding: 10px 0;
    text-align: start;
    width: 100%;
}

.crm-meta-connection-line span {
    color: var(--hunt-muted);
}

.crm-meta-last-error {
    background: #fff4f4;
    border-radius: 7px;
    color: #a33232;
    display: flex;
    font-size: .63rem;
    gap: 7px;
    line-height: 1.7;
    margin: 7px 0 14px;
    padding: 9px;
    text-align: start;
    width: 100%;
}

.crm-meta-settings-panel form {
    height: 100%;
}

.crm-toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: .66rem;
    gap: 8px;
}

.crm-toggle input {
    position: absolute;
    opacity: 0;
}

.crm-toggle span {
    background: #cbd5e1;
    border-radius: 20px;
    height: 23px;
    position: relative;
    transition: .2s ease;
    width: 42px;
}

.crm-toggle span::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    content: '';
    height: 17px;
    inset-inline-start: 3px;
    position: absolute;
    top: 3px;
    transition: .2s ease;
    width: 17px;
}

.crm-toggle input:checked + span {
    background: var(--hunt-teal-dark);
}

.crm-toggle input:checked + span::after {
    transform: translateX(-19px);
}

.crm-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 19px 21px 22px;
}

.crm-admin-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.crm-admin-field > span {
    color: #34445a;
    font-size: .65rem;
    font-weight: 700;
}

.crm-admin-field input,
.crm-admin-field select,
.crm-mapping-row input,
.crm-mapping-row select,
.crm-admin-search input {
    background: #fff;
    border: 1px solid #cfdbe7;
    border-radius: 6px;
    color: var(--hunt-text);
    font-family: inherit;
    font-size: .71rem;
    min-height: 41px;
    outline: none;
    padding: 8px 11px;
    width: 100%;
}

.crm-admin-field input:focus,
.crm-admin-field select:focus,
.crm-mapping-row input:focus,
.crm-mapping-row select:focus,
.crm-admin-search input:focus {
    border-color: var(--hunt-teal);
    box-shadow: 0 0 0 3px rgba(77, 165, 173, .1);
}

.crm-admin-field input:disabled,
.crm-admin-field select:disabled,
.crm-mapping-row input:disabled,
.crm-mapping-row select:disabled {
    background: #f4f7fa;
    color: #65758a;
}

.crm-admin-field small,
.crm-cell-sub {
    color: var(--hunt-muted);
    display: block;
    font-size: .6rem;
    line-height: 1.6;
}

.crm-span-2 {
    grid-column: span 2;
}

.crm-copy-control,
.crm-password-control {
    display: flex;
}

.crm-copy-control input,
.crm-password-control input {
    border-end-end-radius: 0;
    border-start-end-radius: 0;
}

.crm-copy-control button,
.crm-password-control button {
    background: #eff5fa;
    border: 1px solid #cfdbe7;
    border-inline-start: 0;
    border-radius: 6px 0 0 6px;
    color: var(--hunt-blue);
    cursor: pointer;
    min-width: 42px;
}

.crm-stat-rail {
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 9px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
}

.crm-stat-rail article {
    align-items: center;
    display: flex;
    gap: 13px;
    min-height: 91px;
    padding: 17px 21px;
}

.crm-stat-rail article + article {
    border-inline-start: 1px solid var(--hunt-border);
}

.crm-stat-rail article > i {
    align-items: center;
    background: #e6f4f5;
    border-radius: 50%;
    color: var(--hunt-teal-dark);
    display: flex;
    font-size: .95rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.crm-stat-rail article.is-warning > i {
    background: #fff6e6;
    color: #b16e00;
}

.crm-stat-rail article.is-danger > i {
    background: #fff0f0;
    color: #d33f3f;
}

.crm-stat-rail span {
    color: var(--hunt-muted);
    display: block;
    font-size: .64rem;
}

.crm-stat-rail strong {
    color: var(--hunt-blue-ink);
    display: block;
    font-size: 1.3rem;
    margin-top: 2px;
}

.crm-stat-rail strong small {
    color: var(--hunt-muted);
    font-size: .72rem;
    font-weight: 700;
}

.crm-meta-operations-grid {
    align-items: start;
    direction: ltr;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(365px, .85fr) minmax(540px, 1.15fr);
}

.crm-meta-operations-grid > * {
    direction: rtl;
}

.crm-mapping-list {
    display: grid;
    gap: 9px;
    padding: 16px 20px;
}

.crm-mapping-row {
    align-items: center;
    display: grid;
    gap: 9px;
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 30px;
}

.crm-mapping-row > i {
    color: var(--hunt-teal-dark);
    font-size: .7rem;
    text-align: center;
}

.crm-mapping-row > button,
.crm-icon-action {
    align-items: center;
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 6px;
    color: #63768a;
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    text-decoration: none;
    width: 32px;
}

.crm-mapping-row > button:hover,
.crm-icon-action.is-danger:hover {
    border-color: #efb4b4;
    color: #c43838;
}

.crm-icon-action.is-success:hover {
    border-color: #a9dac3;
    color: #19724d;
}

.crm-panel-savebar {
    background: #f7fafc;
    border-top: 1px solid var(--hunt-border);
    gap: 15px;
    justify-content: space-between;
    padding: 13px 20px;
}

.crm-panel-savebar > span {
    color: var(--hunt-muted);
    font-size: .63rem;
}

.crm-panel-savebar > span i {
    color: var(--hunt-teal-dark);
    margin-inline-end: 5px;
}

.crm-admin-table {
    border-collapse: collapse;
    min-width: 680px;
    width: 100%;
}

.crm-admin-table th {
    background: #f6f9fc;
    border-bottom: 1px solid var(--hunt-border);
    color: #5d6d81;
    font-size: .62rem;
    font-weight: 700;
    padding: 11px 14px;
    text-align: start;
    white-space: nowrap;
}

.crm-admin-table td {
    border-bottom: 1px solid #e8eef4;
    color: #33455c;
    font-size: .66rem;
    padding: 11px 14px;
    vertical-align: middle;
}

.crm-admin-table tbody tr:hover {
    background: #fbfdff;
}

.crm-admin-table a {
    color: var(--hunt-blue);
    font-weight: 700;
    text-decoration: none;
}

.crm-empty-cell {
    color: var(--hunt-muted) !important;
    padding: 38px 20px !important;
    text-align: center !important;
}

.crm-admin-pagination {
    padding: 13px 18px;
}

.crm-inline-alert {
    align-items: flex-start;
    border: 1px solid;
    border-radius: 7px;
    display: flex;
    font-size: .7rem;
    gap: 9px;
    line-height: 1.7;
    padding: 12px 14px;
}

.crm-inline-alert.is-error {
    background: #fff4f4;
    border-color: #f1c5c5;
    color: #a33232;
}

.crm-inline-alert.is-info {
    background: #eef7ff;
    border-color: #c9e1f6;
    color: #1f6199;
    margin: 16px 20px 0;
}

.crm-inline-alert ul {
    margin: 4px 0 0;
    padding-inline-start: 18px;
}

.crm-users-toolbar {
    flex-wrap: wrap;
}

.crm-admin-search {
    align-items: center;
    display: flex;
    min-width: min(360px, 100%);
    position: relative;
}

.crm-admin-search > i {
    color: #8391a3;
    inset-inline-start: 12px;
    position: absolute;
}

.crm-admin-search input {
    border-end-end-radius: 0;
    border-start-end-radius: 0;
    padding-inline-start: 35px;
}

.crm-admin-search button {
    background: var(--hunt-blue);
    border: 0;
    border-radius: 6px 0 0 6px;
    color: #fff;
    font-family: inherit;
    font-size: .68rem;
    min-height: 41px;
    padding: 8px 15px;
}

.crm-user-cell {
    gap: 10px;
}

.crm-user-cell strong,
.crm-user-cell small {
    display: block;
}

.crm-user-cell small {
    color: var(--hunt-muted);
    font-size: .58rem;
    margin-top: 3px;
}

.crm-user-avatar {
    align-items: center;
    background: var(--hunt-blue);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .74rem;
    font-weight: 800;
    height: 35px;
    justify-content: center;
    width: 35px;
}

.crm-user-avatar.is-large {
    font-size: 1rem;
    height: 50px;
    width: 50px;
}

.crm-role-chip {
    background: #ecf4fc;
    color: var(--hunt-blue);
}

.crm-role-chip.is-sales {
    background: #e8f7f7;
    color: #197881;
}

.crm-role-chip.is-administrator {
    background: #edf1ff;
    color: #3857b6;
}

.crm-role-chip.is-marketing {
    background: #fff5e5;
    color: #9b6206;
}

.crm-role-chip.is-viewer {
    background: #f0f2f5;
    color: #64748b;
}

.crm-row-actions {
    gap: 5px;
}

.crm-row-actions form {
    margin: 0;
}

.crm-back-link {
    color: var(--hunt-blue);
    display: inline-flex;
    font-size: .68rem;
    gap: 7px;
    margin-bottom: 9px;
    text-decoration: none;
}

.crm-user-form {
    display: grid;
    gap: 17px;
}

.crm-form-page {
    margin: 0 auto;
    max-width: 1180px;
}

.crm-section-icon {
    align-items: center;
    background: #eaf4fb;
    border-radius: 8px;
    color: var(--hunt-blue);
    display: flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.crm-role-selector {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, 1fr);
    padding: 20px;
}

.crm-role-selector label {
    cursor: pointer;
}

.crm-role-selector input {
    position: absolute;
    opacity: 0;
}

.crm-role-selector label > span {
    align-items: center;
    border: 1px solid var(--hunt-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 130px;
    padding: 16px 10px;
    text-align: center;
    transition: .18s ease;
}

.crm-role-selector label > span > i {
    align-items: center;
    background: #edf5fb;
    border-radius: 50%;
    color: var(--hunt-blue);
    display: flex;
    height: 39px;
    justify-content: center;
    margin-bottom: 9px;
    width: 39px;
}

.crm-role-selector b {
    color: var(--hunt-blue-ink);
    font-size: .7rem;
}

.crm-role-selector small {
    color: var(--hunt-muted);
    font-size: .57rem;
    line-height: 1.7;
    margin-top: 5px;
}

.crm-role-selector input:checked + span {
    background: #f0f9fa;
    border-color: var(--hunt-teal);
    box-shadow: 0 0 0 3px rgba(77, 165, 173, .1);
}

.crm-role-selector input:checked + span > i {
    background: var(--hunt-teal-dark);
    color: #fff;
}

.crm-check-row {
    align-items: flex-start;
    border-top: 1px solid var(--hunt-border);
    cursor: pointer;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 15px 20px;
}

.crm-check-row input {
    accent-color: var(--hunt-teal-dark);
    margin-top: 4px;
}

.crm-check-row b,
.crm-check-row small {
    display: block;
}

.crm-check-row b {
    color: #34445a;
    font-size: .69rem;
}

.crm-check-row small {
    color: var(--hunt-muted);
    font-size: .59rem;
    margin-top: 3px;
}

.crm-form-actions {
    gap: 9px;
    justify-content: flex-end;
}

.crm-permissions-layout {
    align-items: start;
    display: grid;
    gap: 15px;
    grid-template-columns: 265px minmax(0, 1fr);
}

.crm-permission-users {
    position: sticky;
    top: 94px;
}

.crm-permission-user-list {
    display: grid;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 8px;
}

.crm-permission-user-list > a {
    align-items: center;
    border-radius: 7px;
    color: var(--hunt-text);
    display: grid;
    gap: 9px;
    grid-template-columns: 35px minmax(0, 1fr) 12px;
    padding: 9px;
    text-decoration: none;
}

.crm-permission-user-list > a:hover,
.crm-permission-user-list > a.is-active {
    background: #ebf5f7;
}

.crm-permission-user-list b,
.crm-permission-user-list small {
    display: block;
}

.crm-permission-user-list b {
    font-size: .66rem;
}

.crm-permission-user-list small {
    color: var(--hunt-muted);
    font-size: .56rem;
    margin-top: 3px;
}

.crm-permission-user-list > a > i {
    color: #9aa8b8;
    font-size: .6rem;
}

.crm-permission-editor__head {
    min-height: 89px;
}

.crm-permission-count {
    text-align: center;
}

.crm-permission-count strong,
.crm-permission-count span {
    display: block;
}

.crm-permission-count strong {
    color: var(--hunt-blue);
    font-size: 1.2rem;
}

.crm-permission-count span {
    color: var(--hunt-muted);
    font-size: .56rem;
}

.crm-permission-toolbar {
    display: flex;
    gap: 7px;
    justify-content: flex-end;
    padding: 13px 20px 0;
}

.crm-permission-toolbar button {
    background: #fff;
    border: 1px solid #cfdbe7;
    border-radius: 6px;
    color: var(--hunt-blue);
    cursor: pointer;
    font-family: inherit;
    font-size: .63rem;
    padding: 7px 11px;
}

.crm-permission-groups {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 14px 20px 20px;
}

.crm-permission-group {
    border: 1px solid var(--hunt-border);
    border-radius: 8px;
    overflow: hidden;
}

.crm-permission-group > header {
    align-items: center;
    background: #f7fafc;
    border-bottom: 1px solid var(--hunt-border);
    display: flex;
    justify-content: space-between;
    padding: 11px 12px;
}

.crm-permission-group > header span {
    align-items: center;
    color: var(--hunt-blue-ink);
    display: flex;
    font-size: .67rem;
    gap: 7px;
}

.crm-permission-group > header span i {
    color: var(--hunt-blue);
}

.crm-permission-group > header label {
    color: var(--hunt-muted);
    font-size: .58rem;
}

.crm-permission-group > header input {
    accent-color: var(--hunt-teal-dark);
    vertical-align: middle;
}

.crm-permission-group > div {
    display: grid;
    gap: 7px;
    padding: 11px;
}

.crm-permission-option {
    cursor: pointer;
}

.crm-permission-option input {
    position: absolute;
    opacity: 0;
}

.crm-permission-option span {
    align-items: center;
    border-radius: 5px;
    color: #536478;
    display: flex;
    font-size: .61rem;
    gap: 7px;
    min-height: 29px;
    padding: 5px 7px;
}

.crm-permission-option span i {
    align-items: center;
    border: 1px solid #c7d3df;
    border-radius: 3px;
    color: transparent;
    display: flex;
    font-size: .48rem;
    height: 15px;
    justify-content: center;
    width: 15px;
}

.crm-permission-option input:checked + span {
    background: #edf8f8;
    color: #286f75;
}

.crm-permission-option input:checked + span i {
    background: var(--hunt-teal-dark);
    border-color: var(--hunt-teal-dark);
    color: #fff;
}

.crm-permission-option input:disabled + span {
    cursor: not-allowed;
    opacity: .72;
}

.crm-panel-savebar.is-sticky {
    bottom: 0;
    position: sticky;
    z-index: 3;
}

.crm-empty-state {
    color: var(--hunt-muted);
    padding: 70px 20px;
    text-align: center;
}

.crm-empty-state > i {
    color: #b8c6d5;
    font-size: 2.2rem;
}

.crm-empty-state h2 {
    font-size: .95rem;
}

@media (max-width: 1200px) {
    .crm-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-meta-operations-grid {
        grid-template-columns: 1fr;
    }

    .crm-role-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .crm-permission-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .crm-meta-config-grid,
    .crm-permissions-layout {
        grid-template-columns: 1fr;
    }

    .crm-meta-connection-card {
        min-height: 280px;
    }

    .crm-permission-users {
        position: static;
    }

    .crm-permission-user-list {
        max-height: 280px;
    }

    .crm-stat-rail {
        grid-template-columns: repeat(2, 1fr);
    }

    .crm-stat-rail article:nth-child(3) {
        border-inline-start: 0;
        border-top: 1px solid var(--hunt-border);
    }

    .crm-stat-rail article:nth-child(4) {
        border-top: 1px solid var(--hunt-border);
    }
}

@media (max-width: 640px) {
    .crm-admin-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .crm-form-grid,
    .crm-permission-groups,
    .crm-role-selector {
        grid-template-columns: 1fr;
    }

    .crm-span-2 {
        grid-column: auto;
    }

    .crm-stat-rail {
        grid-template-columns: 1fr;
    }

    .crm-stat-rail article + article {
        border-inline-start: 0;
        border-top: 1px solid var(--hunt-border);
    }

    .crm-admin-search {
        min-width: 100%;
    }

    .crm-mapping-row {
        border-bottom: 1px solid var(--hunt-border);
        grid-template-columns: minmax(0, 1fr) 29px;
        padding-bottom: 10px;
    }

    .crm-mapping-row > i {
        display: none;
    }

    .crm-mapping-row > input,
    .crm-mapping-row > select {
        grid-column: 1;
    }

    .crm-mapping-row > button {
        grid-column: 2;
        grid-row: 1;
    }

    .crm-panel-savebar {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-panel-savebar .crm-admin-button {
        width: 100%;
    }
}

/* Existing CRM screens, re-skinned inside the standalone shell. */
.crm-portal-body .crm-shell,
.crm-portal-body .crm-page,
.crm-portal-body .crm-modal {
    --crm-primary: var(--hunt-blue);
    --crm-primary-strong: var(--hunt-blue-dark);
    --crm-primary-soft: #e8f2fb;
    --crm-navy: var(--hunt-blue-ink);
    --crm-text: var(--hunt-text);
    --crm-muted: var(--hunt-muted);
    --crm-page: var(--hunt-bg);
    --crm-surface: #fff;
    --crm-surface-alt: #f7fafd;
    --crm-border: var(--hunt-border);
    --crm-border-strong: #c8d5e3;
    --crm-info: var(--hunt-teal-dark);
    --crm-shadow: 0 4px 16px rgba(18, 47, 80, .06);
    --crm-shadow-raised: var(--hunt-shadow);
}

.crm-portal-body .crm-module-nav {
    display: none;
}

.crm-portal-body .crm-page-head {
    margin-bottom: 24px;
}

.crm-portal-body .crm-page-head__copy h1 {
    color: var(--hunt-blue-ink);
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 800;
}

.crm-portal-body .crm-btn--primary {
    background: var(--hunt-teal);
    border-color: var(--hunt-teal);
    box-shadow: 0 7px 16px rgba(49, 139, 148, .18);
}

.crm-portal-body .crm-btn--primary:hover,
.crm-portal-body .crm-btn--primary:focus {
    background: var(--hunt-teal-dark);
}

.crm-portal-body .crm-panel,
.crm-portal-body .crm-kpi-card,
.crm-portal-body .crm-chart-card {
    box-shadow: 0 5px 18px rgba(18, 47, 80, .055);
}

.crm-portal-body .crm-kpi-card strong {
    color: var(--hunt-blue-dark);
}

/* Login surface */
.crm-login-body {
    background: #fff;
    color: var(--hunt-text);
    min-height: 100vh;
}

.crm-login-page {
    direction: ltr;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(470px, .95fr);
    min-height: 100vh;
}

.crm-login-visual,
.crm-login-panel {
    direction: rtl;
}

.crm-login-visual {
    background: #eaf4fc;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.crm-login-visual > img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: center bottom;
    position: absolute;
    width: 100%;
}

.crm-login-visual__copy {
    inset-inline: 8%;
    position: absolute;
    text-align: center;
    top: clamp(45px, 8vh, 92px);
    z-index: 1;
}

.crm-login-visual__copy h1 {
    color: var(--hunt-blue-ink);
    font-size: clamp(2rem, 3.3vw, 3.5rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
}

.crm-login-visual__copy p {
    color: #526477;
    font-size: clamp(.92rem, 1.45vw, 1.24rem);
    margin: 12px 0 0;
}

.crm-login-panel {
    align-items: center;
    background: #fff;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 44px clamp(30px, 5.5vw, 88px);
}

.crm-login-card {
    max-width: 510px;
    width: 100%;
}

.crm-login-brand {
    margin-bottom: clamp(34px, 6vh, 66px);
}

.crm-login-brand > img {
    display: block;
    height: 68px;
    max-width: 220px;
    object-fit: contain;
}

.crm-login-brand > span {
    background: var(--hunt-teal);
    border-radius: 5px;
    color: #fff;
    display: inline-block;
    font-size: .75rem;
    font-weight: 800;
    margin-top: 7px;
    padding: 4px 9px;
}

.crm-wordmark--light .crm-wordmark__mark {
    color: var(--hunt-blue);
}

.crm-wordmark--light .crm-wordmark__name {
    color: var(--hunt-blue);
    font-size: 1.75rem;
}

.crm-wordmark--light .crm-wordmark__tag {
    font-size: .82rem;
}

.crm-login-brand p {
    color: var(--hunt-muted);
    font-size: .68rem;
    margin: 9px 0 0;
}

.crm-login-heading h2 {
    color: var(--hunt-blue-ink);
    font-size: clamp(1.65rem, 2.3vw, 2.2rem);
    font-weight: 800;
    margin: 0;
}

.crm-login-heading p {
    color: var(--hunt-muted);
    font-size: .79rem;
    margin: 8px 0 0;
}

.crm-login-alert {
    align-items: flex-start;
    background: #fff1f1;
    border: 1px solid #f4cccc;
    border-radius: 8px;
    color: #a33232;
    display: flex;
    font-size: .72rem;
    gap: 9px;
    margin-top: 20px;
    padding: 11px 13px;
}

.crm-login-alert--success {
    background: #ebf8f2;
    border-color: #c8ebdc;
    color: #247852;
}

.crm-login-form {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.crm-login-field {
    display: grid;
    gap: 8px;
}

.crm-login-field label {
    color: var(--hunt-text);
    font-size: .75rem;
    font-weight: 700;
}

.crm-login-control {
    align-items: center;
    border: 1px solid #ccd7e3;
    border-radius: 8px;
    display: flex;
    min-height: 53px;
    padding: 0 15px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.crm-login-control:focus-within {
    border-color: var(--hunt-blue);
    box-shadow: 0 0 0 3px rgba(7, 93, 169, .1);
}

.crm-login-control > i {
    color: #8291a4;
    font-size: .9rem;
}

.crm-login-control input {
    background: transparent;
    border: 0;
    color: var(--hunt-text);
    flex: 1;
    font-family: inherit;
    font-size: .78rem;
    height: 51px;
    min-width: 0;
    outline: 0;
    padding: 0 12px;
}

.crm-login-control input::placeholder {
    color: #9aa7b7;
}

.crm-password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #748398;
    cursor: pointer;
    display: flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    width: 36px;
}

.crm-remember {
    align-items: center;
    color: var(--hunt-muted);
    cursor: pointer;
    display: flex;
    font-size: .73rem;
    gap: 9px;
    width: fit-content;
}

.crm-remember input {
    accent-color: var(--hunt-blue);
    height: 17px;
    width: 17px;
}

.crm-login-submit {
    align-items: center;
    background: var(--hunt-blue);
    border: 1px solid var(--hunt-blue);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(7, 93, 169, .2);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: .83rem;
    font-weight: 700;
    justify-content: center;
    min-height: 53px;
    padding: 11px 18px;
    position: relative;
    transition: background-color .18s ease, transform .18s ease;
}

.crm-login-submit i {
    inset-inline-end: 19px;
    position: absolute;
}

.crm-login-submit:hover,
.crm-login-submit:focus-visible {
    background: var(--hunt-blue-dark);
    outline: none;
    transform: translateY(-1px);
}

.crm-login-back {
    align-items: center;
    border: 1px solid var(--hunt-teal);
    border-radius: 8px;
    color: var(--hunt-teal-dark);
    display: flex;
    font-size: .77rem;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    margin-top: 13px;
    min-height: 49px;
    padding: 10px 18px;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}

.crm-login-back:hover,
.crm-login-back:focus-visible {
    background: #edf8f9;
    color: #236f76;
    outline: none;
}

/* CRM personal workspace: profile, notifications and help */
.crm-workspace-page {
    display: grid;
    gap: 22px;
}

.crm-workspace-head {
    align-items: flex-end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.crm-workspace-eyebrow {
    align-items: center;
    color: var(--hunt-teal-dark);
    display: inline-flex;
    font-size: .65rem;
    font-weight: 800;
    gap: 7px;
    margin-bottom: 7px;
}

.crm-workspace-head h1,
.crm-help-hero h1 {
    color: var(--hunt-blue-ink);
    font-size: clamp(1.5rem, 2.3vw, 2.1rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
}

.crm-workspace-head p {
    color: var(--hunt-muted);
    font-size: .75rem;
    line-height: 1.7;
    margin: 6px 0 0;
}

.crm-workspace-link {
    align-items: center;
    color: var(--hunt-blue);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    gap: 7px;
    padding: 8px 0;
    text-decoration: none;
}

.crm-workspace-link:hover,
.crm-workspace-link:focus-visible {
    color: var(--hunt-teal-dark);
    outline: none;
}

.crm-profile-hero {
    align-items: center;
    background: var(--hunt-blue-dark);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 13px;
    box-shadow: var(--hunt-shadow);
    color: #fff;
    display: flex;
    gap: 18px;
    overflow: hidden;
    padding: 24px 27px;
    position: relative;
}

.crm-profile-hero::after {
    border: 32px solid rgba(77, 165, 173, .1);
    border-radius: 50%;
    content: '';
    height: 180px;
    inset-inline-end: 12%;
    position: absolute;
    top: -105px;
    width: 180px;
}

.crm-profile-avatar {
    align-items: center;
    background: var(--hunt-teal);
    border: 4px solid rgba(255, 255, 255, .2);
    border-radius: 13px;
    display: inline-flex;
    flex: 0 0 64px;
    font-size: 1.4rem;
    font-weight: 800;
    height: 64px;
    justify-content: center;
}

.crm-profile-hero__copy {
    flex: 1;
    min-width: 0;
}

.crm-profile-hero__title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crm-profile-hero__title h2 {
    font-size: 1.16rem;
    font-weight: 800;
    margin: 0;
}

.crm-profile-hero__copy p {
    color: rgba(255, 255, 255, .64);
    font-size: .7rem;
    margin: 6px 0 0;
}

.crm-profile-hero__metric {
    align-items: flex-end;
    border-inline-start: 1px solid rgba(255, 255, 255, .14);
    display: flex;
    flex-direction: column;
    min-width: 105px;
    padding-inline-start: 24px;
    position: relative;
    z-index: 1;
}

.crm-profile-hero__metric strong {
    font-size: 1.5rem;
    font-weight: 800;
}

.crm-profile-hero__metric span {
    color: rgba(255, 255, 255, .62);
    font-size: .62rem;
}

.crm-workspace-grid {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
}

.crm-workspace-side {
    display: grid;
    gap: 22px;
}

.crm-workspace-card {
    background: var(--hunt-surface);
    border: 1px solid var(--hunt-border);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(21, 54, 91, .055);
    padding: 22px;
}

.crm-workspace-card__head,
.crm-workspace-card__head > div {
    align-items: center;
    display: flex;
}

.crm-workspace-card__head {
    border-bottom: 1px solid var(--hunt-border);
    justify-content: space-between;
    margin-bottom: 21px;
    padding-bottom: 17px;
}

.crm-workspace-card__head > div {
    gap: 12px;
}

.crm-workspace-card__icon {
    align-items: center;
    background: #eaf3fb;
    border-radius: 9px;
    color: var(--hunt-blue);
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
}

.crm-workspace-card__icon.is-teal { background: #e9f7f5; color: var(--hunt-teal-dark); }
.crm-workspace-card__icon.is-amber { background: #fff5df; color: #ad7419; }

.crm-workspace-card h2,
.crm-notification-toolbar h2,
.crm-help-contact h2 {
    color: var(--hunt-blue-ink);
    font-size: .88rem;
    font-weight: 800;
    margin: 0;
}

.crm-workspace-card__head p,
.crm-notification-toolbar p {
    color: var(--hunt-muted);
    font-size: .64rem;
    line-height: 1.6;
    margin: 3px 0 0;
}

.crm-workspace-fields {
    display: grid;
    gap: 17px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-workspace-fields.is-single {
    grid-template-columns: 1fr;
}

.crm-workspace-card__actions {
    border-top: 1px solid var(--hunt-border);
    display: flex;
    justify-content: flex-end;
    margin-top: 21px;
    padding-top: 17px;
}

.crm-account-facts {
    display: grid;
    gap: 0;
    margin: 0;
}

.crm-account-facts > div {
    align-items: center;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    gap: 15px;
    justify-content: space-between;
    padding: 13px 0;
}

.crm-account-facts > div:first-child { padding-top: 0; }
.crm-account-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }

.crm-account-facts dt {
    color: var(--hunt-muted);
    font-size: .65rem;
    font-weight: 600;
}

.crm-account-facts dd {
    color: var(--hunt-blue-ink);
    font-size: .67rem;
    font-weight: 800;
    margin: 0;
    text-align: end;
}

.crm-notification-stats {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.crm-notification-stats article {
    align-items: center;
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-inline-start: 3px solid currentColor;
    border-radius: 10px;
    color: var(--hunt-blue);
    display: flex;
    gap: 13px;
    padding: 17px 18px;
}

.crm-notification-stats article > span {
    align-items: center;
    background: currentColor;
    border-radius: 8px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.crm-notification-stats article > span i { color: #fff; }
.crm-notification-stats article.is-danger { color: #c95151; }
.crm-notification-stats article.is-teal { color: var(--hunt-teal-dark); }

.crm-notification-stats article div {
    display: flex;
    flex-direction: column;
}

.crm-notification-stats strong {
    color: var(--hunt-blue-ink);
    font-size: 1.15rem;
    line-height: 1.2;
}

.crm-notification-stats small {
    color: var(--hunt-muted);
    font-size: .62rem;
    margin-top: 3px;
}

.crm-notification-center {
    padding: 0;
}

.crm-notification-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--hunt-border);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 21px 22px;
}

.crm-notification-filters {
    align-items: center;
    background: #f2f6fa;
    border: 1px solid #e4ebf2;
    border-radius: 8px;
    display: flex;
    gap: 2px;
    padding: 3px;
}

.crm-notification-filters :is(button, a) {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--hunt-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: .63rem;
    font-weight: 700;
    padding: 7px 11px;
}

.crm-notification-filters :is(button, a).is-active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(21, 54, 91, .08);
    color: var(--hunt-blue);
}

.crm-notification-list {
    display: grid;
}

.crm-notification-item {
    align-items: center;
    border-bottom: 1px solid #edf1f5;
    display: grid;
    gap: 15px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 17px 22px;
    transition: background-color .18s ease;
}

.crm-notification-item:last-child { border-bottom: 0; }
.crm-notification-item:hover { background: #f9fbfd; }
.crm-notification-item[hidden] { display: none; }

.crm-notification-item__icon {
    align-items: center;
    background: #eaf3fb;
    border-radius: 9px;
    color: var(--hunt-blue);
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.crm-notification-item.is-overdue .crm-notification-item__icon { background: #fff0ef; color: #c95151; }

.crm-notification-item__body > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-notification-item__body h3 {
    color: var(--hunt-blue-ink);
    font-size: .72rem;
    font-weight: 800;
    margin: 0;
}

.crm-notification-item__body p {
    color: var(--hunt-muted);
    font-size: .63rem;
    line-height: 1.55;
    margin: 4px 0;
}

.crm-notification-item__body > span {
    color: #8290a1;
    font-size: .57rem;
}

.crm-notification-tag {
    background: #fff0ef;
    border-radius: 5px;
    color: #b84242;
    font-size: .53rem;
    font-weight: 800;
    padding: 3px 7px;
}

.crm-notification-item__action {
    align-items: center;
    color: var(--hunt-blue);
    display: inline-flex;
    font-size: .63rem;
    font-weight: 800;
    gap: 7px;
    text-decoration: none;
}

.crm-notification-item__action:hover,
.crm-notification-item__action:focus-visible { color: var(--hunt-teal-dark); outline: none; }

.crm-workspace-empty {
    color: var(--hunt-muted);
    padding: 48px 22px;
    text-align: center;
}

.crm-workspace-empty > span {
    align-items: center;
    background: #e9f7f5;
    border-radius: 50%;
    color: var(--hunt-teal-dark);
    display: inline-flex;
    font-size: 1.2rem;
    height: 54px;
    justify-content: center;
    margin-bottom: 12px;
    width: 54px;
}

.crm-workspace-empty h2 { color: var(--hunt-blue-ink); font-size: .85rem; margin: 0 0 5px; }
.crm-workspace-empty p { font-size: .64rem; margin: 0; }
.crm-workspace-empty.is-filtered { background: #fff; border: 1px dashed var(--hunt-border); border-radius: 10px; }
.crm-workspace-empty[hidden] { display: none; }

.crm-help-hero {
    align-items: center;
    background: var(--hunt-blue-dark);
    border-radius: 13px;
    color: #fff;
    display: grid;
    gap: 30px;
    grid-template-columns: minmax(0, 1fr) 180px;
    min-height: 264px;
    overflow: hidden;
    padding: clamp(28px, 4vw, 48px);
    position: relative;
}

.crm-help-hero > div:first-child { max-width: 680px; position: relative; z-index: 1; }
.crm-help-hero .crm-workspace-eyebrow { color: #76c9ce; }
.crm-help-hero h1 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.45rem); }
.crm-help-hero p { color: rgba(255, 255, 255, .64); font-size: .73rem; line-height: 1.7; margin: 7px 0 21px; }

.crm-help-search {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 9px;
    display: flex;
    max-width: 570px;
    min-height: 52px;
    padding: 0 16px;
}

.crm-help-search i { color: var(--hunt-teal-dark); }
.crm-help-search input { background: transparent; border: 0; color: var(--hunt-text); flex: 1; font-family: inherit; font-size: .7rem; min-width: 0; outline: 0; padding: 0 12px; }
.crm-help-search span { background: #e9f5f6; border-radius: 6px; color: var(--hunt-teal-dark); font-size: .58rem; font-weight: 800; padding: 6px 9px; }

.crm-help-hero__art {
    align-items: center;
    display: flex;
    justify-content: center;
    position: relative;
}

.crm-help-hero__art > span {
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 28px;
    display: inline-flex;
    font-size: 3.2rem;
    height: 130px;
    justify-content: center;
    transform: rotate(-4deg);
    width: 130px;
}

.crm-help-hero__art > i { color: #f4c46c; font-size: 1.1rem; inset-inline-end: 8px; position: absolute; top: 18px; }

.crm-help-quick-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-help-quick-grid > a {
    align-items: center;
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 10px;
    color: inherit;
    display: grid;
    gap: 11px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 17px;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.crm-help-quick-grid > a:hover,
.crm-help-quick-grid > a:focus-visible { border-color: #b9d9e4; box-shadow: 0 8px 22px rgba(21, 54, 91, .08); outline: none; transform: translateY(-2px); }
.crm-help-quick-grid > a[hidden] { display: none; }

.crm-help-quick-grid > a > span {
    align-items: center;
    background: #eaf3fb;
    border-radius: 8px;
    color: var(--hunt-blue);
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.crm-help-quick-grid > a > span.is-teal { background: #e9f7f5; color: var(--hunt-teal-dark); }
.crm-help-quick-grid > a > span.is-amber { background: #fff5df; color: #ad7419; }
.crm-help-quick-grid > a > span.is-violet { background: #f0edfb; color: #7252af; }
.crm-help-quick-grid h2 { color: var(--hunt-blue-ink); font-size: .7rem; font-weight: 800; margin: 0; }
.crm-help-quick-grid p { color: var(--hunt-muted); font-size: .58rem; line-height: 1.55; margin: 3px 0 0; }
.crm-help-quick-grid > a > i { color: #9eabb9; font-size: .62rem; }

.crm-help-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.55fr) minmax(270px, .65fr);
}

.crm-help-faq details { border-bottom: 1px solid #edf1f5; }
.crm-help-faq details:last-child { border-bottom: 0; }
.crm-help-faq summary { align-items: center; color: var(--hunt-blue-ink); cursor: pointer; display: flex; font-size: .7rem; font-weight: 800; justify-content: space-between; list-style: none; padding: 15px 0; }
.crm-help-faq summary::-webkit-details-marker { display: none; }
.crm-help-faq summary i { color: #93a0af; font-size: .56rem; transition: transform .18s ease; }
.crm-help-faq details[open] summary i { transform: rotate(180deg); }
.crm-help-faq details p { color: var(--hunt-muted); font-size: .65rem; line-height: 1.85; margin: -3px 0 16px; max-width: 780px; }

.crm-help-contact {
    background: #edf7f8;
    border: 1px solid #cce5e7;
    border-radius: 12px;
    padding: 25px;
}

.crm-help-contact > span { align-items: center; background: var(--hunt-teal); border-radius: 9px; color: #fff; display: inline-flex; font-size: 1.05rem; height: 45px; justify-content: center; margin-bottom: 16px; width: 45px; }
.crm-help-contact p { color: var(--hunt-muted); font-size: .65rem; line-height: 1.8; margin: 7px 0 19px; }
.crm-help-contact .crm-admin-button { justify-content: center; width: 100%; }

/* CRM user guide */
.crm-guide-page {
    color: var(--hunt-text);
    display: grid;
    gap: 20px;
}

.crm-guide-header {
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(21, 54, 91, .055);
    display: grid;
    gap: 18px 28px;
    grid-template-columns: minmax(320px, .82fr) minmax(420px, 1.18fr);
    padding: 25px 28px;
    position: relative;
}

.crm-guide-title {
    align-items: center;
    display: flex;
    gap: 15px;
}

.crm-guide-title__icon,
.crm-guide-panel__icon {
    align-items: center;
    background: #e8f2fb;
    border-radius: 12px;
    color: var(--hunt-blue);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.15rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.crm-guide-title h1 {
    color: var(--hunt-blue-ink);
    font-size: clamp(1.6rem, 2.4vw, 2.15rem);
    font-weight: 900;
    line-height: 1.25;
    margin: 0;
}

.crm-guide-title p {
    color: var(--hunt-muted);
    font-size: .76rem;
    line-height: 1.8;
    margin: 6px 0 0;
    max-width: 580px;
}

.crm-guide-search {
    align-items: center;
    align-self: center;
    background: #f8fafc;
    border: 1px solid #ccd8e4;
    border-radius: 10px;
    display: flex;
    min-height: 52px;
    padding: 0 15px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.crm-guide-search:focus-within {
    background: #fff;
    border-color: #66aab7;
    box-shadow: 0 0 0 3px rgba(62, 161, 174, .11);
}

.crm-guide-search > i { color: var(--hunt-teal-dark); font-size: .92rem; }
.crm-guide-search input { background: transparent; border: 0; color: var(--hunt-blue-ink); flex: 1; font-family: inherit; font-size: .78rem; min-width: 0; outline: 0; padding: 0 12px; }
.crm-guide-search input::placeholder { color: #8a9aab; }
.crm-guide-search kbd { background: #e8f4f5; border: 0; border-radius: 6px; box-shadow: none; color: var(--hunt-teal-dark); font-family: inherit; font-size: .6rem; font-weight: 800; padding: 6px 9px; }
.crm-guide-search-status { bottom: 6px; color: var(--hunt-teal-dark); font-size: .6rem; inset-inline-end: 29px; margin: 0; position: absolute; }

.crm-guide-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(205px, .62fr) minmax(560px, 2.2fr) minmax(245px, .72fr);
}

.crm-guide-nav,
.crm-guide-panel,
.crm-guide-results,
.crm-guide-support,
.crm-guide-links {
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 13px;
}

.crm-guide-nav {
    overflow: hidden;
    position: sticky;
    top: 88px;
}

.crm-guide-section-head,
.crm-guide-panel__head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.crm-guide-section-head { border-bottom: 1px solid #e7edf3; padding: 18px 19px; }
.crm-guide-section-head h2,
.crm-guide-panel__head h2,
.crm-guide-support h2 { color: var(--hunt-blue-ink); font-size: .92rem; font-weight: 900; margin: 0; }
.crm-guide-section-head p,
.crm-guide-panel__head p { color: var(--hunt-muted); font-size: .62rem; line-height: 1.65; margin: 4px 0 0; }

.crm-guide-nav__items { display: grid; padding: 8px 0; }
.crm-guide-nav__items button {
    align-items: center;
    background: transparent;
    border: 0;
    border-inline-start: 3px solid transparent;
    color: #52667d;
    cursor: pointer;
    display: grid;
    font-family: inherit;
    font-size: .69rem;
    font-weight: 700;
    gap: 10px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 10px 16px;
    text-align: start;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
    width: 100%;
}
.crm-guide-nav__items button > i:first-child { color: #6c8299; font-size: .77rem; text-align: center; }
.crm-guide-nav__items button > i:last-child { color: #a6b2bf; font-size: .5rem; }
.crm-guide-nav__items button:hover { background: #f7fafc; color: var(--hunt-blue); }
.crm-guide-nav__items button:focus-visible { box-shadow: inset 0 0 0 2px #66aab7; outline: 0; }
.crm-guide-nav__items button.is-active { background: linear-gradient(90deg, rgba(231, 247, 248, .9), rgba(239, 246, 252, .65)); border-inline-start-color: var(--hunt-teal); color: var(--hunt-teal-dark); }
.crm-guide-nav__items button.is-active > i:first-child { color: var(--hunt-teal); }

.crm-guide-content { min-width: 0; }
.crm-guide-panel,
.crm-guide-results { box-shadow: 0 8px 28px rgba(21, 54, 91, .045); padding: 24px; }
.crm-guide-panel[hidden], .crm-guide-results[hidden] { display: none; }
.crm-guide-panel { animation: crmGuideReveal .22s ease both; }
.crm-guide-panel__head { border-bottom: 1px solid #e7edf3; gap: 20px; margin-bottom: 22px; padding-bottom: 17px; }
.crm-guide-panel__head h2 { font-size: 1.05rem; }
.crm-guide-panel__head p { font-size: .68rem; }
.crm-guide-panel__icon { border-radius: 10px; font-size: .9rem; height: 42px; width: 42px; }
.crm-guide-panel__icon.is-blue { background: #e9f3fc; color: #1f70b3; }
.crm-guide-panel__icon.is-amber { background: #fff4df; color: #ad7419; }
.crm-guide-panel__icon.is-violet { background: #f0edfb; color: #7252af; }

.crm-guide-journey {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(5, minmax(118px, 1fr));
    overflow-x: auto;
    padding: 8px 0 23px;
}
.crm-guide-journey article {
    border-inline-end: 1px dashed #cbd7e3;
    min-width: 118px;
    padding: 0 14px;
    position: relative;
    text-align: center;
}
.crm-guide-journey article:first-child { padding-inline-start: 0; }
.crm-guide-journey article:last-child { border-inline-end: 0; padding-inline-end: 0; }
.crm-guide-journey article > span { align-items: center; background: var(--hunt-blue); border: 3px solid #e9f2fb; border-radius: 50%; color: #fff; display: flex; font-size: .62rem; font-weight: 900; height: 26px; justify-content: center; margin: 0 auto 11px; width: 26px; }
.crm-guide-journey article > i { align-items: center; background: #f1f6fa; border: 1px solid #dce6ef; border-radius: 50%; color: var(--hunt-teal-dark); display: flex; font-size: .9rem; height: 46px; justify-content: center; margin: 0 auto 12px; width: 46px; }
.crm-guide-journey h3 { color: var(--hunt-blue-ink); font-size: .7rem; font-weight: 900; margin: 0 0 5px; }
.crm-guide-journey p { color: var(--hunt-muted); font-size: .59rem; line-height: 1.7; margin: 0 auto; max-width: 150px; }
.crm-guide-journey a,
.crm-guide-articles article a { color: var(--hunt-blue); display: inline-flex; font-size: .59rem; font-weight: 800; gap: 6px; margin-top: 10px; text-decoration: none; }
.crm-guide-journey a:hover,
.crm-guide-articles article a:hover { color: var(--hunt-teal-dark); }

.crm-guide-principles { border-top: 1px solid #edf1f5; display: grid; gap: 0; grid-template-columns: repeat(3, 1fr); padding-top: 20px; }
.crm-guide-principles > div { align-items: flex-start; display: flex; gap: 10px; padding: 0 16px; }
.crm-guide-principles > div + div { border-inline-start: 1px solid #e8edf3; }
.crm-guide-principles > div:first-child { padding-inline-start: 0; }
.crm-guide-principles > div:last-child { padding-inline-end: 0; }
.crm-guide-principles > div > i { color: var(--hunt-teal); font-size: .78rem; margin-top: 3px; }
.crm-guide-principles strong { color: var(--hunt-blue-ink); display: block; font-size: .66rem; }
.crm-guide-principles small { color: var(--hunt-muted); display: block; font-size: .58rem; line-height: 1.7; margin-top: 3px; }

.crm-guide-articles { display: grid; gap: 15px; }
.crm-guide-articles > article {
    background: #fbfcfe;
    border: 1px solid #e2e9f0;
    border-radius: 11px;
    display: grid;
    gap: 15px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 19px;
}
.crm-guide-article__icon { align-items: center; background: #e9f3fc; border-radius: 10px; color: var(--hunt-blue); display: flex; font-size: .88rem; height: 42px; justify-content: center; width: 42px; }
.crm-guide-article__icon.is-teal { background: #e8f6f4; color: var(--hunt-teal-dark); }
.crm-guide-article__icon.is-amber { background: #fff4df; color: #ad7419; }
.crm-guide-article__icon.is-violet { background: #f0edfb; color: #7252af; }
.crm-guide-articles h3 { color: var(--hunt-blue-ink); font-size: .78rem; font-weight: 900; margin: 0 0 8px; }
.crm-guide-articles p,
.crm-guide-articles ol { color: #607287; font-size: .66rem; line-height: 1.9; margin: 0; }
.crm-guide-articles ol { padding-inline-start: 19px; }
.crm-guide-articles li::marker { color: var(--hunt-teal-dark); font-weight: 900; }

.crm-guide-faq details,
.crm-guide-results__list > details { border: 1px solid #e2e9f0; border-radius: 9px; margin-bottom: 10px; overflow: hidden; }
.crm-guide-faq details:last-child { margin-bottom: 0; }
.crm-guide-faq summary,
.crm-guide-results__list > details summary { align-items: center; color: var(--hunt-blue-ink); cursor: pointer; display: flex; font-size: .72rem; font-weight: 800; justify-content: space-between; list-style: none; padding: 15px 17px; }
.crm-guide-faq summary::-webkit-details-marker,
.crm-guide-results__list > details summary::-webkit-details-marker { display: none; }
.crm-guide-faq summary i,
.crm-guide-results__list > details summary i { color: #8fa0b1; font-size: .55rem; transition: transform .18s ease; }
.crm-guide-faq details[open] summary,
.crm-guide-results__list > details[open] summary { background: #f8fbfd; }
.crm-guide-faq details[open] summary i,
.crm-guide-results__list > details[open] summary i { transform: rotate(180deg); }
.crm-guide-faq details p,
.crm-guide-results__list > details p { border-top: 1px solid #edf1f5; color: var(--hunt-muted); font-size: .66rem; line-height: 1.9; margin: 0; padding: 14px 17px; }

.crm-guide-results__list { display: grid; gap: 12px; }
.crm-guide-results__list > article { background: #fbfcfe; border: 1px solid #e2e9f0; border-radius: 10px; color: var(--hunt-muted); font-size: .66rem; line-height: 1.8; padding: 18px; }
.crm-guide-results__list > article h3 { color: var(--hunt-blue-ink); font-size: .76rem; margin: 5px 0; }
.crm-guide-results__list > article > span { background: var(--hunt-blue); border-radius: 50%; color: #fff; display: inline-flex; font-size: .58rem; height: 23px; justify-content: center; padding-top: 2px; width: 23px; }
.crm-guide-results__list > article > i { color: var(--hunt-teal-dark); margin-inline: 8px; }
.crm-guide-results__list > article a { color: var(--hunt-blue); font-weight: 800; text-decoration: none; }
.crm-guide-results__list > article > div:last-child > div:first-child { float: right; margin-inline-end: 14px; }
.crm-guide-no-results { color: var(--hunt-muted); padding: 42px 20px; text-align: center; }
.crm-guide-no-results[hidden] { display: none; }
.crm-guide-no-results > i { align-items: center; background: #e9f5f6; border-radius: 50%; color: var(--hunt-teal-dark); display: inline-flex; font-size: 1rem; height: 48px; justify-content: center; margin-bottom: 12px; width: 48px; }
.crm-guide-no-results h3 { color: var(--hunt-blue-ink); font-size: .8rem; margin: 0 0 5px; }
.crm-guide-no-results p { font-size: .63rem; margin: 0; }

.crm-guide-aside { display: grid; gap: 16px; }
.crm-guide-support { background: linear-gradient(145deg, #ecf8f8, #f4fafb); border-color: #c8e5e7; padding: 22px; }
.crm-guide-support__icon { align-items: center; background: var(--hunt-teal); border-radius: 10px; color: #fff; display: flex; font-size: 1rem; height: 44px; justify-content: center; margin-bottom: 15px; width: 44px; }
.crm-guide-support p { color: #61798b; font-size: .65rem; line-height: 1.9; margin: 8px 0 17px; }
.crm-guide-support > a { align-items: center; background: #fff; border: 1px solid #b9d6dc; border-radius: 8px; color: var(--hunt-blue); display: flex; font-size: .65rem; font-weight: 800; gap: 7px; justify-content: center; min-height: 40px; padding: 8px 11px; text-decoration: none; }
.crm-guide-support > a:hover { border-color: var(--hunt-teal); color: var(--hunt-teal-dark); }
.crm-guide-support > a.is-whatsapp { border-color: #a7dec1; color: #087a48; }
.crm-guide-support > a.is-whatsapp:hover { background: #effbf4; border-color: #25a865; color: #05643a; transform: translateY(-1px); }

.crm-guide-links { overflow: hidden; }
.crm-guide-links > a { align-items: center; color: inherit; display: grid; gap: 10px; grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 17px; text-decoration: none; transition: background-color .16s ease; }
.crm-guide-links > a + a { border-top: 1px solid #edf1f5; }
.crm-guide-links > a:hover { background: #f8fbfd; }
.crm-guide-links > a > span { align-items: center; background: #edf4fa; border-radius: 8px; color: var(--hunt-blue); display: flex; height: 35px; justify-content: center; width: 35px; }
.crm-guide-links strong { color: var(--hunt-blue-ink); display: block; font-size: .67rem; }
.crm-guide-links small { color: var(--hunt-muted); display: block; font-size: .56rem; margin-top: 2px; }
.crm-guide-links > a > i { color: #9caab8; font-size: .54rem; }

@keyframes crmGuideReveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .crm-guide-panel { animation: none; }
}

@media (max-width: 1350px) {
    .crm-guide-layout { grid-template-columns: minmax(200px, .55fr) minmax(0, 2fr); }
    .crm-guide-aside { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .crm-guide-header { grid-template-columns: 1fr; }
    .crm-guide-layout { grid-template-columns: 1fr; }
    .crm-guide-nav { position: static; }
    .crm-guide-nav__items { display: flex; overflow-x: auto; padding: 8px; }
    .crm-guide-nav__items button { border: 1px solid transparent; border-radius: 8px; flex: 0 0 auto; grid-template-columns: auto auto; min-height: 42px; padding: 9px 13px; width: auto; }
    .crm-guide-nav__items button > i:last-child { display: none; }
    .crm-guide-nav__items button.is-active { border-color: #c5e1e4; }
    .crm-guide-aside { grid-column: auto; }
}

@media (max-width: 680px) {
    .crm-guide-header { padding: 20px; }
    .crm-guide-title { align-items: flex-start; }
    .crm-guide-title__icon { height: 45px; width: 45px; }
    .crm-guide-panel, .crm-guide-results { padding: 19px; }
    .crm-guide-journey { grid-template-columns: 1fr; overflow: visible; }
    .crm-guide-journey article { align-items: center; border-inline-end: 0; border-top: 1px dashed #d4dee8; display: grid; gap: 8px 11px; grid-template-columns: auto auto minmax(0, 1fr); padding: 15px 0; text-align: start; }
    .crm-guide-journey article:first-child { border-top: 0; padding-top: 0; }
    .crm-guide-journey article > span, .crm-guide-journey article > i { margin: 0; }
    .crm-guide-journey article > i { height: 40px; width: 40px; }
    .crm-guide-journey article h3 { margin: 0; }
    .crm-guide-journey article p, .crm-guide-journey article a { grid-column: 3; margin: 0; max-width: none; }
    .crm-guide-principles { grid-template-columns: 1fr; }
    .crm-guide-principles > div { padding: 13px 0; }
    .crm-guide-principles > div + div { border-inline-start: 0; border-top: 1px solid #e8edf3; }
    .crm-guide-articles > article { grid-template-columns: 1fr; }
    .crm-guide-aside { grid-template-columns: 1fr; }
    .crm-guide-search kbd { display: none; }
}

@media (min-width: 901px) and (max-height: 820px) {
    .crm-app-brand {
        min-height: 74px;
        padding-bottom: 10px;
    }

    .crm-app-sidebar:hover .crm-app-brand,
    .crm-app-sidebar:focus-within .crm-app-brand {
        min-height: 84px;
        padding-bottom: 12px;
    }

    .crm-app-navigation {
        gap: 2px;
        padding-block: 8px;
    }

    .crm-app-navigation__item {
        height: 40px;
        min-height: 40px;
    }

    .crm-app-navigation__section {
        margin-block: 4px 2px;
        min-height: 14px;
    }

    .crm-app-sidebar__footer {
        padding-top: 8px;
    }

    .crm-sidebar-account {
        margin-bottom: 4px;
    }
}

@media (max-width: 1100px) {
    :root {
        --crm-sidebar-expanded-width: 238px;
    }

    .crm-help-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-workspace-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }

    .crm-app-footer__brand-copy,
    .crm-app-footer__copyright {
        display: none;
    }

    .crm-app-footer__options > a {
        min-width: 90px;
    }

    .crm-login-page {
        grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr);
    }

    .crm-login-visual__copy h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 900px) {
    .crm-app-sidebar,
    .crm-app-sidebar:hover,
    .crm-app-sidebar:focus-within {
        box-shadow: -18px 0 40px rgba(4, 31, 61, .2);
        overflow: hidden;
        padding: 22px 15px 16px;
        transform: translateX(105%);
        transition: transform .22s ease;
        width: min(272px, 86vw);
    }

    .crm-portal-body .crm-app-sidebar .crm-app-brand {
        align-items: flex-start;
        min-height: 104px;
        padding: 0 8px 18px;
    }

    .crm-portal-body .crm-app-sidebar .crm-app-brand > img {
        width: 154px;
    }

    .crm-portal-body .crm-app-sidebar .crm-wordmark {
        gap: 8px;
    }

    .crm-portal-body .crm-app-sidebar .crm-app-navigation__item {
        gap: 12px;
        justify-content: flex-start;
        padding-inline: 13px;
        width: 100%;
    }

    .crm-portal-body .crm-app-sidebar .crm-app-navigation__section {
        gap: 10px;
        justify-content: flex-start;
        margin-inline: 12px;
    }

    .crm-portal-body .crm-app-sidebar .crm-app-navigation__section::after {
        flex: 1;
    }

    .crm-portal-body .crm-app-sidebar .crm-app-navigation__item > span,
    .crm-portal-body .crm-app-sidebar .crm-app-navigation__section > span,
    .crm-portal-body .crm-app-sidebar .crm-app-brand p,
    .crm-portal-body .crm-app-sidebar .crm-app-brand > .crm-app-brand__tag,
    .crm-portal-body .crm-app-sidebar .crm-wordmark__name,
    .crm-portal-body .crm-app-sidebar .crm-wordmark__tag,
    .crm-portal-body .crm-app-sidebar .crm-sidebar-account__copy,
    .crm-portal-body .crm-app-sidebar .crm-sidebar-account__arrow {
        max-width: 180px;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .crm-portal-body .crm-app-sidebar .crm-sidebar-account {
        gap: 10px;
        justify-content: flex-start;
        padding-inline: 4px 10px;
        width: 100%;
    }

    .crm-portal-body .crm-app-sidebar .crm-sidebar-badge {
        border-color: transparent;
        margin-inline-start: auto;
        position: static;
    }

    .crm-app-main {
        margin-inline-start: 0;
    }

    .crm-app-footer {
        inset-inline-start: 0;
    }

    .crm-app-menu-button {
        display: inline-flex;
    }

    .crm-sidebar-open .crm-app-sidebar {
        transform: translateX(0);
    }

    .crm-sidebar-open .crm-app-overlay {
        display: block;
    }

    .crm-login-page {
        grid-template-columns: 1fr;
    }

    .crm-login-visual {
        display: none;
    }

    .crm-login-panel {
        background: #f4f8fc;
    }

    .crm-workspace-grid,
    .crm-help-layout {
        grid-template-columns: 1fr;
    }

    .crm-workspace-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .crm-app-content {
        padding: 18px 13px calc(24px + var(--crm-dock-height));
    }

    .crm-app-topbar {
        height: 64px;
        padding: 0 14px;
    }

    .crm-app-topbar__context {
        display: none;
    }

    .crm-app-sidebar {
        max-width: 86vw;
    }

    .crm-app-footer {
        height: 68px;
    }

    .crm-app-footer__inner {
        display: block;
        padding: 5px 7px;
    }

    .crm-app-footer__brand {
        display: none;
    }

    .crm-app-footer__options {
        gap: 1px;
        height: 100%;
        justify-content: space-between;
        width: 100%;
    }

    .crm-app-footer__options > a {
        border: 0;
        flex: 1 1 20%;
        flex-direction: column;
        gap: 2px;
        height: 58px;
        min-width: 0;
        padding: 3px 1px;
    }

    .crm-app-footer__options > a:hover,
    .crm-app-footer__options > a:focus-visible,
    .crm-app-footer__options > a.is-active {
        background: transparent;
        border-color: transparent;
        transform: none;
    }

    .crm-app-footer__options > a.is-active::before {
        background: var(--hunt-teal);
        border-radius: 0 0 999px 999px;
        content: '';
        height: 3px;
        position: absolute;
        top: -5px;
        width: 30px;
    }

    .crm-app-footer__icon {
        background: transparent;
        border-color: transparent;
        flex-basis: 30px;
        height: 30px;
    }

    .crm-app-footer__options > a.is-active .crm-app-footer__icon {
        background: #e4f4f2;
        border-color: #c5e7e4;
    }

    .crm-app-footer__label {
        font-size: .49rem;
        line-height: 1.25;
    }

    .crm-app-footer__options > a > b {
        inset-inline-start: 8px;
        top: 1px;
    }

    .crm-workspace-head {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .crm-workspace-head > .crm-admin-button {
        justify-content: center;
        width: 100%;
    }

    .crm-profile-hero {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 20px;
    }

    .crm-profile-hero__copy {
        flex-basis: calc(100% - 84px);
    }

    .crm-profile-hero__metric {
        align-items: flex-start;
        border-inline-start: 0;
        border-top: 1px solid rgba(255, 255, 255, .14);
        flex-basis: 100%;
        padding: 14px 0 0;
    }

    .crm-workspace-side,
    .crm-workspace-fields,
    .crm-notification-stats,
    .crm-help-quick-grid {
        grid-template-columns: 1fr;
    }

    .crm-workspace-card {
        padding: 18px;
    }

    .crm-notification-center {
        padding: 0;
    }

    .crm-notification-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 18px;
    }

    .crm-notification-filters {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .crm-notification-item {
        align-items: start;
        gap: 11px;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 16px 18px;
    }

    .crm-notification-item__action {
        grid-column: 2;
        justify-self: start;
    }

    .crm-help-hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 28px 22px;
    }

    .crm-help-hero__art {
        display: none;
    }

    .crm-portal-body .crm-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-portal-body .crm-page-head__actions,
    .crm-portal-body .crm-page-head__actions .crm-btn,
    .crm-portal-body .crm-page-head > .crm-btn {
        width: 100%;
    }

    .crm-login-panel {
        align-items: flex-start;
        padding: 34px 20px;
    }

    .crm-login-brand {
        margin-bottom: 46px;
    }

    .crm-wordmark--light .crm-wordmark__name {
        font-size: 1.45rem;
    }

    .crm-login-heading h2 {
        font-size: 1.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* ===== زر إضافة عميل بارز في الـ sidebar ===== */
.crm-app-navigation__add-lead {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff !important;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(34, 197, 94, .35);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.crm-app-navigation__add-lead:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(34, 197, 94, .45);
    filter: brightness(1.05);
}
.crm-app-navigation__add-lead i { font-size: 1.1rem; }

/* شرح الصلاحيات أسفل كل خانة في شاشة الصلاحيات */
.crm-permission-group__hint {
    margin: -2px 0 10px;
    padding-inline-start: 26px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--crm-muted, #64748b);
}
.crm-permission-option__hint {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--crm-muted, #64748b);
}
.crm-permission-option { align-items: flex-start; }
.crm-permission-option input { margin-top: 4px; }

/* شريط تنزيل الأدلة في شاشة دليل المستخدم */
.crm-guide-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}
.crm-guide-downloads a {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 220px;
    padding: 10px 14px;
    border: 1px solid var(--crm-border, #dbe3ef);
    border-radius: 10px;
    background: var(--crm-surface, #fff);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.crm-guide-downloads a:hover { border-color: #0b5d3b; transform: translateY(-1px); }
.crm-guide-downloads a > span { display: flex; flex-direction: column; flex: 1; }
.crm-guide-downloads a small { color: var(--crm-muted, #64748b); font-size: 11.5px; }
.crm-guide-downloads a > i:first-child { color: #0b5d3b; font-size: 18px; }
.crm-guide-downloads a > i:last-child { color: #b91c1c; }


/* ============================================================
   ضبط بوابة CRM فوق قشرة الـERP
   ============================================================ */

/* نصوص أغمق في كل الشاشة */
.crm-portal-body,
.crm-portal-body .crm-shell,
.crm-portal-body .table,
.crm-portal-body .form-label,
.crm-portal-body p,
.crm-portal-body td,
.crm-portal-body th { color: var(--hunt-text); }

.crm-portal-body .text-muted,
.crm-portal-body small.text-muted,
.crm-portal-body .crm-kpi-card small,
.crm-portal-body .crm-page-head__copy p { color: var(--hunt-muted) !important; }

/* الاتجاه يتبع لغة الصفحة بدل التثبيت على العربية */
.crm-shell { text-align: start; }

/* مساحة أسفل الصفحة حتى لا يمر المحتوى تحت الفوتر الثابت */
.crm-portal-body #main-content { padding-bottom: 86px !important; }
.crm-portal-body #main-content > main.py-4 { padding-bottom: 0 !important; }

/* الخلفية موحّدة على كل الطبقات حتى لا يظهر أكثر من لون */
html, body.crm-portal-body, .crm-portal-body #main-content, .crm-portal-body main.py-4 {
    background: var(--hunt-bg);
}

/* عنوان القسم داخل القائمة الجانبية لا يظهر إلا عند الفتح */
.sidebar-hunter .sidebar-hunter-section { overflow: hidden; }
.sidebar-hunter .sidebar-hunter-section span {
    display: block;
    padding: 14px 16px 6px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .4px;
    color: var(--hunt-muted);
    white-space: nowrap;
    opacity: 0;
    transition: opacity .2s ease;
}
.sidebar-hunter:hover .sidebar-hunter-section span,
.sidebar-hunter.expanded .sidebar-hunter-section span { opacity: 1; }

/* ============================================================
   بطاقات الرسوم البيانية — تصميم حديث
   ============================================================ */
.crm-portal-body .crm-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.crm-portal-body .crm-chart-card {
    background: var(--hunt-surface);
    border: 1px solid var(--hunt-border);
    border-radius: 16px;
    padding: 18px 18px 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
    transition: box-shadow .22s ease, transform .22s ease;
}
.crm-portal-body .crm-chart-card:hover {
    box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 34px rgba(16, 24, 40, .09);
    transform: translateY(-2px);
}
.crm-portal-body .crm-chart-card--wide { grid-column: span 2; }
@media (max-width: 900px) { .crm-portal-body .crm-chart-card--wide { grid-column: span 1; } }

.crm-portal-body .crm-chart-card > header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
}
.crm-portal-body .crm-chart-card > header h2 {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.1px;
    color: var(--hunt-text);
}
.crm-portal-body .crm-chart-card__dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--dot, var(--hunt-blue));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, #0c4a8c) 16%, transparent);
    flex: none;
}
.crm-portal-body .crm-chart-card__canvas { position: relative; height: 240px; }
.crm-portal-body .crm-chart-card--wide .crm-chart-card__canvas { height: 268px; }

/* ============================================================
   الموبايل — الشغل اليومي كله من الهاتف
   ============================================================ */

/* زر طيّ الفلاتر: يظهر على الموبايل فقط */
.crm-filters-toggle { display: none; }

@media (max-width: 991px) {
    .crm-portal-body .crm-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 12px 14px;
        background: var(--hunt-surface);
        border: 1px solid var(--hunt-border);
        border-radius: 12px;
        font-weight: 700;
        font-size: .95rem;
        color: var(--hunt-text);
    }
    .crm-portal-body .crm-filter-panel[data-crm-filters] {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .crm-portal-body .crm-filter-panel.is-open [data-crm-filters-body] {
        margin-top: 10px;
        background: var(--hunt-surface);
        border: 1px solid var(--hunt-border);
        border-radius: 12px;
        padding: 14px;
    }
    .crm-portal-body .crm-filters-toggle .fa-chevron-down { transition: transform .2s ease; }
    .crm-portal-body .crm-filter-panel.is-open .crm-filters-toggle .fa-chevron-down { transform: rotate(180deg); }
    .crm-filters-toggle__count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        margin-inline-start: 8px;
        padding: 0 6px;
        border-radius: 10px;
        background: var(--hunt-blue);
        color: #fff;
        font-size: .72rem;
    }
}

@media (max-width: 991px) {
    /* كثافة أفضل: بطاقتان بجوار بعضهما بدل واحدة */
    .crm-portal-body .crm-kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .crm-portal-body .crm-kpi-card { padding: 12px; }
    .crm-portal-body .crm-kpi-card strong { font-size: 1.15rem; }
    .crm-portal-body .crm-kpi-card small { font-size: .74rem; line-height: 1.4; }
    .crm-portal-body .crm-kpi-card__action { display: none; }

    /* الرسوم البيانية عمود واحد بارتفاع مناسب للهاتف */
    .crm-portal-body .crm-chart-grid { grid-template-columns: 1fr; }
    .crm-portal-body .crm-chart-card--wide { grid-column: span 1; }
    .crm-portal-body .crm-chart-card__canvas,
    .crm-portal-body .crm-chart-card--wide .crm-chart-card__canvas { height: 220px; }

    /* الجداول تتمرر أفقيًا بسلاسة مع تلميح بصري */
    .crm-portal-body .table-responsive {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }
    .crm-portal-body .table-responsive > table { font-size: .84rem; }
    .crm-portal-body .table-responsive > table th,
    .crm-portal-body .table-responsive > table td { white-space: nowrap; padding: 8px 10px; }

    /* رأس الصفحة وأزراره */
    .crm-portal-body .crm-page-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .crm-portal-body .crm-page-head h1 { font-size: 1.35rem; }
    .crm-portal-body .crm-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .crm-portal-body .crm-export-actions > * { flex: 1 1 auto; text-align: center; }

    /* تبويبات التقارير تتمرر أفقيًا بدل ما تتكسر */
    .crm-portal-body .crm-report-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .crm-portal-body .crm-report-tabs::-webkit-scrollbar { display: none; }
    .crm-portal-body .crm-report-tabs > a { white-space: nowrap; flex: none; }

    /* مساحات أصغر ومناطق لمس أكبر */
    .crm-portal-body main.py-4 { padding-top: 12px !important; padding-bottom: 0 !important; }
    .crm-portal-body .container-fluid { padding-inline: 12px; }
    .crm-portal-body .crm-panel { border-radius: 12px; }
    .crm-portal-body .btn,
    .crm-portal-body .crm-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .crm-portal-body .form-control,
    .crm-portal-body .form-select { min-height: 44px; font-size: 16px; } /* 16px يمنع تكبير الصفحة على iOS */
    .crm-portal-body .select2-container .select2-selection { min-height: 44px; }

    /* شبكات الحالات والبطاقات عمود أو عمودين */
    .crm-portal-body .crm-status-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .crm-portal-body .crm-dashboard-status-card__description { display: none; }
}

@media (max-width: 575px) {
    .crm-portal-body .crm-status-card-grid { grid-template-columns: 1fr; }
    .crm-portal-body .crm-kpi-grid { grid-template-columns: 1fr; }
}

/* منع تمدد الرسوم داخل الشبكة (canvas تجبر العنصر على الاتساع) */
.crm-portal-body .crm-chart-grid > * { min-width: 0; }
.crm-portal-body .crm-chart-card__canvas { min-width: 0; }
.crm-portal-body .crm-chart-card__canvas > canvas { max-width: 100% !important; }
.crm-portal-body .crm-kpi-grid > * { min-width: 0; }
.crm-portal-body .crm-status-card-grid > * { min-width: 0; }

@media (max-width: 991px) {
    /* العمود الأول يفضل ثابتًا أثناء التمرير الأفقي حتى يظل اسم العميل ظاهرًا */
    .crm-portal-body .table-responsive > table > thead > tr > th:first-child,
    .crm-portal-body .table-responsive > table > tbody > tr > td:first-child {
        position: sticky;
        inset-inline-start: 0;
        z-index: 2;
        background: var(--hunt-surface);
        box-shadow: 1px 0 0 var(--hunt-border);
    }
    .crm-portal-body .table-responsive > table > thead > tr > th:first-child { z-index: 3; background: #eef2f7; }
    [dir="rtl"] .crm-portal-body .table-responsive > table > thead > tr > th:first-child,
    [dir="rtl"] .crm-portal-body .table-responsive > table > tbody > tr > td:first-child {
        box-shadow: -1px 0 0 var(--hunt-border);
    }
}

/* ألوان الهوية على عناصر بقيت بلون Bootstrap الافتراضي */
.crm-portal-body .crm-report-tabs a.is-active,
.crm-portal-body .crm-report-tabs .is-active {
    background: var(--hunt-blue) !important;
    border-color: var(--hunt-blue) !important;
    color: #fff !important;
}
.crm-portal-body .bg-primary { background-color: var(--hunt-blue) !important; }
.crm-portal-body .btn-primary {
    background-color: var(--hunt-blue) !important;
    border-color: var(--hunt-blue) !important;
}
.crm-portal-body .text-primary { color: var(--hunt-blue) !important; }
.crm-portal-body .progress-bar.bg-primary { background-color: var(--hunt-blue) !important; }

/* روابط الحساب داخل القائمة الجانبية — للموبايل فقط */
.sidebar-hunter-item--mobile { display: none; }
.sidebar-hunter-link--button {
    width: 100%;
    background: none;
    border: none;
    text-align: inherit;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.crm-sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-inline-start: 6px;
    padding: 0 5px;
    border-radius: 9px;
    background: #dc2626;
    color: #fff;
    font-size: .68rem;
}
@media (max-width: 768px) {
    .sidebar-hunter-item--mobile { display: block; }
}

/* ============================================================
   شريط الموبايل السفلي ولوحة الأدوات — نفس أسلوب tech.huntivia.com
   ============================================================ */
:root { --crm-mob-h: 58px; --crm-safe-b: env(safe-area-inset-bottom, 0px); }

.mob-bar, .mob-sheet, .mob-sheet-backdrop { display: none; }

@media (max-width: 992px) {
    /* شريط الفوتر الأصلي يختفي ويحل محله شريط التنقل */
    .crm-portal-body .footer-nav { display: none !important; }

    .crm-portal-body #main-content { padding-bottom: calc(var(--crm-mob-h) + var(--crm-safe-b) + 14px) !important; }

    .mob-bar {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 1050;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        height: calc(var(--crm-mob-h) + var(--crm-safe-b));
        padding-bottom: var(--crm-safe-b);
        background: var(--hunt-surface);
        border-top: 1px solid var(--hunt-border);
        box-shadow: 0 -12px 30px -28px rgba(12, 74, 140, .5);
    }
    .mob-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 100%;
        min-width: 0;
        background: none;
        border: 0;
        padding: 0;
        position: relative;
        color: var(--hunt-muted);
        font-family: 'Cairo', sans-serif;
        font-size: 10px;
        font-weight: 700;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
    }
    .mob-item i { font-size: 18px; line-height: 1; }
    .mob-item > span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }
    .mob-item:active { transform: scale(.96); }
    .mob-item.is-active { color: var(--hunt-blue); }
    .mob-item .mob-dot {
        position: absolute;
        top: 5px;
        inset-inline-end: calc(50% - 20px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: #dc2626;
        color: #fff;
        font-size: 9px;
        display: grid;
        place-items: center;
    }
    .mob-item.primary i {
        width: 46px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        background: linear-gradient(135deg, var(--hunt-blue), var(--hunt-blue-dark));
        color: #fff;
        box-shadow: 0 6px 16px -8px rgba(12, 74, 140, .9);
    }

    .mob-sheet {
        display: block;
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 1060;
        background: var(--hunt-surface);
        border-top: 3px solid var(--hunt-blue);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -20px 60px -20px rgba(15, 23, 42, .55);
        transform: translateY(105%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s;
        padding: 10px 14px calc(16px + var(--crm-safe-b));
        max-height: 78vh;
        overflow-y: auto;
    }
    .mob-sheet.show { transform: translateY(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
    .mob-sheet-grip { width: 42px; height: 4px; border-radius: 999px; background: var(--hunt-border); margin: 4px auto 12px; }
    .mob-sheet-title {
        margin: 0 2px 10px;
        color: var(--hunt-blue);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 1.5px;
        text-transform: uppercase;
    }
    .mob-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .mob-grid form { display: block; margin: 0; }
    .mob-tile {
        width: 100%;
        min-width: 0;
        min-height: 74px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        position: relative;
        padding: 12px 6px;
        background: #f8fafc;
        border: 1px solid var(--hunt-border);
        border-radius: 10px;
        color: var(--hunt-text);
        font-family: 'Cairo', sans-serif;
        font-size: 10.5px;
        font-weight: 700;
        text-align: center;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
    }
    .mob-tile i { color: var(--hunt-blue); font-size: 19px; }
    .mob-tile:active { background: #eef4fb; transform: scale(.97); }
    .mob-tile.is-danger, .mob-tile.is-danger i { color: #b91c1c; }
    .mob-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        display: block;
        background: rgba(15, 23, 42, .55);
        opacity: 0;
        visibility: hidden;
        transition: opacity .28s ease, visibility .28s ease;
    }
    .mob-sheet-backdrop.show { opacity: 1; visibility: visible; }
    body.crm-sheet-open { overflow: hidden; }
}

@media (max-width: 420px) {
    .mob-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== مخزون الوحدات (Inventory) ===== */
.crm-inventory-target {
    background: rgba(94, 179, 166, .12);
    border: 1px solid rgba(94, 179, 166, .45);
    color: var(--hunt-text);
    border-radius: 12px;
    font-weight: 600;
}
.crm-unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.crm-unit-grid > * { min-width: 0; }
.crm-unit-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: box-shadow .18s ease, transform .18s ease;
}
.crm-unit-card:hover { box-shadow: 0 6px 18px rgba(12, 74, 140, .10); transform: translateY(-2px); }
.crm-unit-card--available { border-inline-start: 4px solid #16a34a; }
.crm-unit-card--reserved { border-inline-start: 4px solid #d97706; }
.crm-unit-card--contract_signing { border-inline-start: 4px solid #2563a8; }
.crm-unit-card--sold { border-inline-start: 4px solid #6b7280; }
/* ===== فصل وحدات الإيجار عن وحدات البيع ===== */
.crm-purpose-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    font-weight: 800;
    margin: 22px 0 12px;
    padding: 9px 14px;
    border-radius: 12px;
}
.crm-purpose-heading__count {
    font-size: .78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
}
.crm-purpose-heading--sale { background: rgba(37, 99, 168, .10); color: #1d4ed8; border-inline-start: 4px solid #2563a8; }
.crm-purpose-heading--rent { background: rgba(124, 58, 237, .10); color: #6d28d9; border-inline-start: 4px solid #7c3aed; }

/* بطاقات الإيجار بلون مختلف تماماً عن بطاقات البيع */
.crm-unit-card--purpose-sale { border-inline-start: 4px solid #2563a8; }
.crm-unit-card--purpose-rent {
    border-inline-start: 4px solid #7c3aed;
    background: linear-gradient(180deg, rgba(124, 58, 237, .055), #fff 72px);
    border-color: rgba(124, 58, 237, .28);
}
.crm-unit-card--purpose-rent:hover { box-shadow: 0 6px 18px rgba(124, 58, 237, .16); }
.crm-unit-card--purpose-rent .crm-unit-card__code { color: #5b21b6; }

.crm-unit-card__name { margin: 2px 0 0; font-size: .86rem; font-weight: 700; color: var(--hunt-text); }
.crm-unit-card__official { margin: 1px 0 0; font-size: .76rem; color: var(--hunt-muted); letter-spacing: .3px; }

.crm-unit-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.crm-unit-card__code { font-size: 1.02rem; font-weight: 800; color: var(--hunt-text); margin: 0; word-break: break-word; }
.crm-unit-card__project { margin: 2px 0 0; font-size: .82rem; color: var(--hunt-muted); }
.crm-unit-card__meta { margin: 0; font-size: .8rem; color: var(--hunt-muted); }
.crm-unit-badge {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.crm-unit-badge--available { background: rgba(22, 163, 74, .12); color: #15803d; }
.crm-unit-badge--reserved { background: rgba(217, 119, 6, .14); color: #b45309; }
.crm-unit-badge--contract_signing { background: rgba(37, 99, 168, .12); color: #1d4ed8; }
.crm-unit-badge--sold { background: rgba(107, 114, 128, .16); color: #4b5563; }
.crm-unit-card__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    margin: 0;
    padding: 10px 0;
    border-top: 1px dashed var(--hunt-border);
    border-bottom: 1px dashed var(--hunt-border);
}
.crm-unit-card__facts dt { font-size: .72rem; color: var(--hunt-muted); font-weight: 500; margin: 0; }
.crm-unit-card__facts dd { font-size: .92rem; color: var(--hunt-text); font-weight: 700; margin: 0; }
.crm-unit-card__price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.crm-unit-card__price small { font-size: .76rem; color: var(--hunt-muted); }
.crm-unit-card__price strong { font-size: 1.12rem; font-weight: 800; color: var(--hunt-blue); }
.crm-unit-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-unit-card__actions .btn { white-space: nowrap; }
.crm-existing-customer-label { display:block; color:#087f5b; font-weight:700; margin-top:3px; }
.crm-lead-existing-customer { color:#087f5b; }
.crm-lead-brochures a { display:inline-flex; align-items:center; gap:4px; margin-inline-start:6px; padding:3px 8px; border-radius:999px; background:#eaf3ff; color:#145ea8; font-size:.8rem; font-weight:700; text-decoration:none; }
.crm-lead-brochures a:hover { background:#d8eaff; color:#0b4b8c; }
.crm-customer-history { margin:18px 0; padding:16px; border:1px solid #b9e2d3; border-radius:14px; background:#f2fbf7; }
.crm-customer-history > header { display:flex; gap:11px; align-items:flex-start; }
.crm-customer-history > header > span { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:#d5f3e6; color:#087f5b; }
.crm-customer-history h2 { font-size:1rem; margin:0; color:#154c3d; font-weight:800; }
.crm-customer-history p { margin:3px 0 0; color:#52736a; font-size:.84rem; }
.crm-customer-history__cycles { display:flex; gap:8px; flex-wrap:wrap; margin-top:13px; }
.crm-customer-history__cycle { min-width:190px; flex:1 1 220px; padding:10px; border:1px solid #d4ebe1; border-radius:10px; background:#fff; color:inherit; text-decoration:none; }
.crm-customer-history__cycle:hover { border-color:#28a57c; color:inherit; }
.crm-customer-history__cycle strong, .crm-customer-history__cycle span, .crm-customer-history__cycle small { display:block; }
.crm-customer-history__cycle strong { color:#087f5b; font-size:.83rem; }
.crm-customer-history__cycle span { font-weight:700; font-size:.87rem; margin-top:3px; }
.crm-customer-history__cycle small { color:#627a72; margin-top:4px; font-size:.77rem; }
.crm-customer-history__feedback { margin:13px 0 0; padding:0; list-style:none; border-top:1px solid #d4ebe1; }
.crm-customer-history__feedback li { display:grid; grid-template-columns:145px minmax(150px, .7fr) 2fr; gap:8px; padding:9px 0; border-bottom:1px solid #e4f2ec; font-size:.82rem; }
.crm-customer-history__feedback time, .crm-customer-history__feedback span { color:#627a72; }
.crm-customer-history__feedback strong { font-weight:600; color:#274c40; }
@media (max-width: 700px) { .crm-customer-history__feedback li { grid-template-columns:1fr; gap:3px; } }
.crm-unit-detail {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 8px 0; border-bottom: 1px solid var(--hunt-border);
}
.crm-unit-detail:last-child { border-bottom: 0; }
.crm-unit-detail span { font-size: .82rem; color: var(--hunt-muted); }
.crm-unit-detail strong { font-size: .92rem; color: var(--hunt-text); text-align: end; word-break: break-word; }
.crm-unit-detail--empty strong { color: var(--hunt-muted); font-weight: 500; }
.crm-unit-detail-group {
    margin: 16px 0 4px; padding-bottom: 6px; font-size: .8rem; font-weight: 700;
    color: var(--hunt-primary, #0f8f95); border-bottom: 2px solid var(--hunt-border);
    text-transform: none; letter-spacing: .2px;
}
.crm-unit-detail-group:first-child { margin-top: 0; }

@media (max-width: 575.98px) {
    .crm-unit-grid { grid-template-columns: 1fr; }
    .crm-unit-card__actions .btn { flex: 1 1 100%; }
}

/* ===== شاشة "لا توجد صلاحية" ===== */
.crm-denied {
    max-width: 780px;
    margin: 24px auto;
    background: #fff;
    border: 1px solid var(--hunt-border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .05);
}
.crm-denied__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(194, 63, 91, .10); color: #c23f5b; font-size: 1.6rem;
    margin-bottom: 14px;
}
.crm-denied__title { font-size: 1.32rem; font-weight: 800; color: var(--hunt-text); margin: 0 0 2px; }
.crm-denied__title-en { font-size: 1rem; font-weight: 600; color: var(--hunt-muted); margin: 0 0 20px; }
.crm-denied__reason {
    display: grid; gap: 14px; text-align: start;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 18px;
}
.crm-denied__reason-block {
    background: var(--hunt-bg);
    border: 1px solid var(--hunt-border);
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 0;
}
.crm-denied__label {
    display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; color: var(--hunt-blue); margin-bottom: 6px;
}
.crm-denied__reason-block p { margin: 0 0 8px; font-size: .92rem; color: var(--hunt-text); line-height: 1.7; }
.crm-denied__reason-block p:last-child { margin-bottom: 0; }
.crm-denied__note { font-size: .84rem !important; color: var(--hunt-muted) !important; }
.crm-denied__meta {
    display: grid; gap: 8px; text-align: start; margin: 0 0 18px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.crm-denied__meta > div {
    background: var(--hunt-bg); border: 1px dashed var(--hunt-border);
    border-radius: 10px; padding: 8px 12px; min-width: 0;
}
.crm-denied__meta dt { font-size: .72rem; color: var(--hunt-muted); font-weight: 600; margin: 0; }
.crm-denied__meta dd { font-size: .88rem; color: var(--hunt-text); font-weight: 700; margin: 0; word-break: break-all; }
.crm-denied__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (max-width: 575.98px) {
    .crm-denied { padding: 20px 14px; margin: 12px auto; }
    .crm-denied__actions .btn { flex: 1 1 100%; }
}

/* ===== التوزيع الجماعي للعملاء ===== */
.crm-bulk-cell { width: 38px; text-align: center; }
.crm-bulk-cell .form-check-input { cursor: pointer; margin: 0; width: 18px; height: 18px; }
.crm-leads-table tr.crm-row-selected { background: rgba(37, 99, 168, .07); }
body.crm-bulk-active { padding-bottom: 96px; }
.crm-bulk-bar {
    position: fixed;
    inset-inline: 12px;
    bottom: 76px;
    z-index: 1035;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: var(--hunt-blue);
    color: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(12, 74, 140, .28);
}
.crm-bulk-bar__count { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.crm-bulk-bar__count strong { font-size: 1.2rem; font-weight: 800; }
.crm-bulk-bar__count span { font-size: .82rem; opacity: .9; }
.crm-bulk-bar__select { max-width: 220px; min-width: 150px; }
.crm-bulk-bar__check { display: flex; align-items: center; gap: 6px; font-size: .82rem; cursor: pointer; margin: 0; }
.crm-bulk-bar__check .form-check-input { margin: 0; }
.crm-bulk-bar .crm-btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .45); }
.crm-bulk-bar .crm-btn--ghost:hover { background: rgba(255, 255, 255, .12); }
@media (max-width: 767.98px) {
    .crm-bulk-bar { inset-inline: 8px; bottom: 70px; padding: 10px; gap: 8px; }
    .crm-bulk-bar__select { max-width: none; flex: 1 1 100%; }
    .crm-bulk-bar .btn { flex: 1 1 calc(50% - 4px); }
    body.crm-bulk-active { padding-bottom: 160px; }
}

/* ===== التوزيع التلقائي ===== */
.crm-auto-summary {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    background: var(--hunt-bg); border: 1px solid var(--hunt-border);
    border-radius: 12px; padding: 12px; margin-bottom: 14px; text-align: center;
}
.crm-auto-summary > div { min-width: 0; }
.crm-auto-summary strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--hunt-text); line-height: 1.2; }
.crm-auto-summary span { font-size: .76rem; color: var(--hunt-muted); }
.crm-auto-summary__result strong { color: var(--hunt-blue); }
.crm-auto-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.crm-auto-agent {
    display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0;
    border: 1px solid var(--hunt-border); border-radius: 10px; padding: 9px 12px;
    background: #fff; transition: border-color .15s ease, background .15s ease;
}
.crm-auto-agent:hover { border-color: var(--hunt-blue-light); }
.crm-auto-agent.is-present { border-inline-start: 4px solid #16a34a; }
.crm-auto-agent .form-check-input { margin: 0; flex-shrink: 0; width: 18px; height: 18px; }
.crm-auto-agent__body { flex: 1 1 auto; min-width: 0; }
.crm-auto-agent__name { display: block; font-weight: 700; color: var(--hunt-text); font-size: .93rem; }
.crm-auto-agent__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.crm-auto-agent__load { font-size: .76rem; color: var(--hunt-muted); }
.crm-auto-agent__share {
    flex-shrink: 0; min-width: 40px; text-align: center; font-weight: 800;
    font-size: 1.05rem; color: var(--hunt-blue);
    background: rgba(37, 99, 168, .09); border-radius: 8px; padding: 4px 8px;
}
.crm-auto-badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.crm-auto-badge--on { background: rgba(22, 163, 74, .13); color: #15803d; }
.crm-auto-badge--off { background: rgba(217, 119, 6, .14); color: #b45309; }
.crm-auto-badge--never { background: rgba(107, 114, 128, .16); color: #4b5563; }
.crm-auto-options { background: var(--hunt-bg); border-radius: 10px; padding: 10px 12px; }
.crm-auto-options label { display: flex; align-items: center; gap: 7px; font-size: .87rem; margin: 0; cursor: pointer; }

/* Keep actionable lead context visible within each notification row. */
.crm-notification-item--detailed {
    grid-template-columns: 42px minmax(180px, .7fr) minmax(320px, 1.5fr) auto;
    align-items: start;
    padding-block: 22px;
}
.crm-notification-item--detailed .crm-notification-item__body h3 { font-size: .82rem; }
.crm-notification-item--detailed .crm-notification-item__body p { font-size: .73rem; }
.crm-notification-item--detailed .crm-notification-item__body > span { font-size: .66rem; }
.crm-notification-context { min-width: 0; font-size: .75rem; overflow-wrap: anywhere; }
.crm-notification-context__facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.crm-notification-fact { background: #f1f5f9; border-radius: 8px; padding: 8px 12px; display: grid; gap: 4px; }
.crm-notification-fact > span { color: #596b7c; font-size: .68rem; }
.crm-notification-fact strong { color: var(--hunt-blue-ink); }
.crm-notification-fact.is-late { background: #fff0ef; }
.crm-notification-fact.is-late strong { color: #b84242; }
.crm-notification-context__history { display: grid; gap: 18px; }
.crm-notification-context__history.has-transfers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.crm-notification-context h4 { color: #596b7c; font-size: .7rem; margin: 0 0 9px; display: flex; gap: 6px; align-items: center; }
.crm-notification-context p { margin: 5px 0; line-height: 1.7; }
.crm-notification-context small, .crm-notification-context time { display: block; color: #65758a; font-size: .65rem; line-height: 1.7; }
.crm-notification-note { white-space: pre-line; }
.crm-notification-context summary { color: var(--hunt-teal-dark); cursor: pointer; margin-block: 6px; }
.crm-notification-context summary:focus-visible { outline: 2px solid var(--hunt-teal-dark); outline-offset: 3px; }
.crm-notification-transfers { border-inline-start: 1px solid #e4ebf1; padding-inline-start: 16px; }
.crm-notification-transfers ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.crm-notification-transfers li + li { border-top: 1px solid #edf1f5; padding-top: 8px; }
.crm-notification-item--detailed .crm-notification-item__action { margin-top: 8px; }
@media (max-width: 1200px) {
    .crm-notification-item--detailed { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .crm-notification-item--detailed .crm-notification-context { grid-column: 2 / -1; grid-row: 2; }
    .crm-notification-item--detailed .crm-notification-item__action { grid-column: 3; grid-row: 1; }
}
@media (max-width: 600px) {
    .crm-notification-item--detailed { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 18px 14px; }
    .crm-notification-item--detailed .crm-notification-item__icon { width: 32px; height: 32px; }
    .crm-notification-item--detailed .crm-notification-context { grid-column: 1 / -1; }
    .crm-notification-context__history.has-transfers { grid-template-columns: minmax(0, 1fr); }
    .crm-notification-transfers { border-inline-start: 0; border-top: 1px solid #e4ebf1; padding-inline-start: 0; padding-top: 14px; }
    .crm-notification-item--detailed .crm-notification-item__action { grid-column: 2; grid-row: 3; }
}

.crm-notification-item__body > .crm-notification-owner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 10px 12px;
    background: #eaf5f2;
    border: 1px solid #cce6de;
    border-radius: 8px;
    color: #176a58;
    overflow-wrap: anywhere;
}
.crm-notification-owner > span { display: grid; gap: 4px; min-width: 0; }
.crm-notification-owner small { font-size: .7rem; line-height: 1.5; }
.crm-notification-owner strong { font-size: .9rem; line-height: 1.6; }
.crm-notification-item__body > .crm-notification-owner.is-late {
    background: #fff1ef;
    border-color: #f2d3ce;
    color: #963b32;
}

.crm-meeting-range { padding: 18px 22px; margin-bottom: 18px; }
.crm-meeting-range h2 { font-size: .95rem; margin: 0 0 14px; }
.crm-meeting-range__fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.crm-meeting-range__fields label { display: grid; gap: 6px; font-size: .8rem; flex: 1 1 180px; }
.crm-meeting-range__fields input { width: 100%; min-width: 0; border: 1px solid #ccd8e3; border-radius: 7px; padding: 9px 12px; background: #fff; color: #17364d; }
.crm-meeting-range__presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.crm-meeting-range p { font-size: .75rem; color: #596b7c; margin: 12px 0 0; }
@media (max-width: 600px) { .crm-meeting-range { padding: 16px; } .crm-meeting-range__fields label { flex-basis: 100%; } }

/* أي مودال طويل في الـCRM: الجسم هو اللي يسكرول ويفضل الفوتر (أزرار الحفظ/الإرسال)
   ظاهر دايمًا — من غير ده الأزرار بتنزل تحت حدود الشاشة على اللابتوب. */
.crm-portal-body .crm-modal .modal-content {
    max-height: calc(100vh - 3.5rem);
}
.crm-portal-body .crm-modal .modal-body {
    overflow-y: auto;
}
.crm-portal-body .crm-modal .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}
