/* ==============================================================
   Infotattva CRM product page extensions
   Builds on the shared ERP product-page design system.
================================================================= */
.crm-page {
    --crm-teal: #0da77a;
    --crm-coral: #ef6a62;
    --crm-purple: #7b55cf;
}

.crm-page .crm-hero .erp-hero-copy h1 {
    font-size: clamp(42px, 4.6vw, 64px);
}

.crm-page .crm-chart-area {
    fill: url(#crmHeroFill);
}

.crm-source-donut {
    position: relative;
    display: grid;
    width: 78px;
    height: 78px;
    margin: 14px auto 10px;
    background: conic-gradient(#1877df 0 42%, #7b55cf 42% 70%, #0db37a 70% 88%, #ffaf52 88% 100%);
    border-radius: 50%;
    place-items: center;
}

.crm-source-donut::before {
    position: absolute;
    inset: 11px;
    content: "";
    background: #fff;
    border-radius: 50%;
}

.crm-source-donut > span {
    position: relative;
    z-index: 1;
    color: #173251;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.crm-source-donut small {
    display: block;
    color: #7a899e;
    font-size: 5px;
    font-weight: 500;
}

.crm-page .crm-challenge .erp-section-head h2 {
    font-size: clamp(32px, 3.3vw, 46px);
}

.crm-page .crm-challenge .erp-challenge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-page .crm-challenge .erp-challenge-card:nth-child(1) i { color: #ff7972; background: rgba(239, 106, 98, .12); }
.crm-page .crm-challenge .erp-challenge-card:nth-child(2) i { color: #ffac55; background: rgba(255, 172, 85, .12); }
.crm-page .crm-challenge .erp-challenge-card:nth-child(3) i { color: #a080e8; background: rgba(160, 128, 232, .12); }
.crm-page .crm-challenge .erp-challenge-card:nth-child(4) i { color: #56a7ff; background: rgba(86, 167, 255, .12); }

.crm-page .crm-ecosystem .erp-core {
    background: linear-gradient(135deg, #1977df, #0b56bc);
}

/* CRM dashboard showcase */
.crm-pipeline-chart {
    padding: 12px;
    background: #fff;
    border: 1px solid #e4ecf5;
    border-radius: 7px;
}

.crm-pipeline-chart > strong {
    color: #17304f;
    font-size: 8px;
}

.crm-funnel {
    display: grid;
    justify-items: center;
    gap: 5px;
    margin-top: 13px;
}

.crm-funnel span {
    display: flex;
    justify-content: space-between;
    width: var(--w);
    min-width: 42%;
    padding: 7px 9px;
    color: #fff;
    font-size: 6px;
    background: linear-gradient(90deg, #1f75d8, #3ba9e8);
    border-radius: 3px;
}

.crm-funnel span:nth-child(2) { opacity: .9; }
.crm-funnel span:nth-child(3) { opacity: .8; }
.crm-funnel span:nth-child(4) { opacity: .7; }
.crm-funnel span:nth-child(5) { opacity: .6; }

.crm-mobile-tasks {
    display: grid;
    gap: 8px;
}

.crm-mobile-tasks > span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 7px;
    background: #f4f8fc;
    border-radius: 7px;
}

.crm-mobile-tasks i {
    display: grid;
    width: 24px;
    height: 24px;
    color: #1f75d8;
    font-size: 9px;
    background: #e1efff;
    border-radius: 6px;
    place-items: center;
}

.crm-mobile-tasks b {
    color: #19324f;
    font-size: 8px;
}

.crm-mobile-tasks small {
    display: block;
    margin-top: 2px;
    color: #8997a9;
    font-size: 6px;
}

.crm-phone > button {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    color: #fff;
    font-size: 8px;
    background: var(--erp-blue);
    border: 0;
    border-radius: 6px;
}

/* Customer 360 */
.crm-profile-ui {
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr) 225px;
    max-width: 1180px;
    min-height: 560px;
    margin: auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce7f3;
    border-radius: 18px;
    box-shadow: 0 24px 55px rgba(15, 55, 99, .11);
}

.crm-contact-list {
    padding: 22px 14px;
    background: #0d2948;
}

.crm-ui-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 11px;
    color: #9db5cf;
    font-size: 11px;
    background: rgba(255, 255, 255, .07);
    border-radius: 7px;
}

.crm-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    color: #c1d1e2;
    border-radius: 8px;
}

.crm-contact.active {
    color: #fff;
    background: rgba(42, 128, 228, .33);
}

.crm-contact > span {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    background: #2576d8;
    border-radius: 50%;
    place-items: center;
}

.crm-contact div {
    display: grid;
}

.crm-contact strong {
    font-size: 12px;
}

.crm-contact small {
    margin-top: 2px;
    color: #8fa9c3;
    font-size: 9px;
}

.crm-profile-main {
    min-width: 0;
    padding: 28px;
}

.crm-profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.crm-avatar {
    display: grid;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #2578dc, #17a2d2);
    border-radius: 16px;
    place-items: center;
}

.crm-profile-head > div:nth-child(2) {
    flex: 1;
}

.crm-profile-head span {
    color: #2473d2;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.crm-profile-head h3 {
    margin: 3px 0;
    font-size: 23px;
}

.crm-profile-head p {
    margin: 0;
    font-size: 12px;
}

.crm-profile-head button {
    width: 35px;
    height: 35px;
    color: #63768c;
    background: #f2f6fa;
    border: 0;
    border-radius: 8px;
}

.crm-profile-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 25px 0;
}

.crm-profile-facts span {
    display: grid;
    padding: 12px;
    background: #f6f9fc;
    border: 1px solid #e7edf4;
    border-radius: 8px;
}

.crm-profile-facts small {
    color: #8492a4;
    font-size: 9px;
}

.crm-profile-facts strong {
    margin-top: 3px;
    color: #263d57;
    font-size: 11px;
}

.crm-profile-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 10px;
    border-bottom: 1px solid #e7edf4;
}

.crm-profile-tabs button {
    flex: 0 0 auto;
    padding: 7px 9px;
    color: #66788c;
    font-size: 10px;
    background: transparent;
    border: 0;
    border-radius: 5px;
}

.crm-profile-tabs button.active {
    color: #1f70ce;
    background: #eaf3ff;
}

.crm-timeline {
    position: relative;
    display: grid;
    gap: 18px;
    margin-top: 23px;
}

.crm-timeline::before {
    position: absolute;
    top: 19px;
    bottom: 19px;
    left: 17px;
    width: 1px;
    content: "";
    background: #d8e5f2;
}

.crm-timeline article {
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 13px;
}

.crm-timeline article > i {
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    color: #2474d2;
    font-size: 12px;
    background: #e9f3ff;
    border: 4px solid #fff;
    border-radius: 50%;
    place-items: center;
}

.crm-timeline strong {
    color: #203751;
    font-size: 12px;
}

.crm-timeline p {
    margin: 3px 0;
    font-size: 10px;
    line-height: 1.45;
}

.crm-timeline small {
    color: #91a0b1;
    font-size: 8px;
}

.crm-profile-side {
    padding: 29px 20px;
    background: #f6f9fc;
    border-left: 1px solid #e3ebf4;
}

.crm-profile-side h4 {
    margin: 0 0 16px;
    font-size: 14px;
}

.crm-profile-side h4:nth-of-type(2) {
    margin-top: 30px;
}

.crm-profile-side > div {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e4ebf3;
    border-radius: 8px;
}

.crm-profile-side > div i {
    color: #2473d2;
}

.crm-profile-side > div span {
    display: grid;
}

.crm-profile-side > div strong {
    color: #273e58;
    font-size: 11px;
}

.crm-profile-side > div small {
    margin-top: 3px;
    color: #8795a6;
    font-size: 8px;
}

.crm-profile-side > p {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 10px 0;
    font-size: 11px;
    border-bottom: 1px solid #e2e9f1;
}

.crm-profile-side > p b {
    color: #1d3652;
}

/* Sales pipeline */
.crm-kanban-wrap {
    overflow-x: auto;
    padding: 7px 7px 20px;
    scrollbar-color: #b8cee5 #edf3f9;
    scrollbar-width: thin;
}

.crm-kanban-wrap > .erp-sample-label {
    margin-bottom: 13px;
}

.crm-kanban {
    display: grid;
    grid-template-columns: repeat(7, minmax(165px, 1fr));
    gap: 11px;
    min-width: 1210px;
}

.crm-kanban-column {
    min-height: 315px;
    padding: 13px;
    background: #f5f8fc;
    border: 1px solid #e2eaf3;
    border-radius: 11px;
}

.crm-kanban-column > h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 15px;
    font-size: 12px;
}

.crm-kanban-column > h3 > i {
    width: 7px;
    height: 7px;
    background: #478de3;
    border-radius: 50%;
}

.crm-kanban-column > h3 .contacted { background: #1eb8bd; }
.crm-kanban-column > h3 .qualified { background: #7b63d9; }
.crm-kanban-column > h3 .proposal { background: #e59843; }
.crm-kanban-column > h3 .negotiation { background: #d868a5; }
.crm-kanban-column > h3 .won { background: #18a96f; }
.crm-kanban-column > h3 .lost { background: #d86161; }
.crm-kanban-column > h3 b { margin-left: auto; padding: 3px 6px; color: #718197; font-size: 8px; background: #e8eef5; border-radius: 9px; }

.crm-kanban-column article {
    padding: 13px;
    background: #fff;
    border: 1px solid #e0e8f1;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(20, 56, 94, .06);
}

.crm-kanban-column article strong,
.crm-kanban-column article > span {
    display: block;
}

.crm-kanban-column article strong {
    color: #213a56;
    font-size: 11px;
}

.crm-kanban-column article > span {
    margin: 6px 0 14px;
    color: #167054;
    font-size: 13px;
    font-weight: 700;
}

.crm-kanban-column article p,
.crm-kanban-column article small {
    margin: 0;
    color: #748398;
    font-size: 9px;
}

.crm-kanban-column article small {
    display: block;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #ecf0f5;
}

/* CRM workflow */
.crm-page .crm-workflow .erp-flow {
    grid-template-columns: repeat(8, 1fr);
}

/* Automation */
.crm-auto-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.crm-auto-flow span {
    padding: 8px 11px;
    color: #246fc8;
    font-size: 11px;
    font-weight: 600;
    background: #e9f3ff;
    border-radius: 7px;
}

.crm-auto-flow i {
    color: #91afd1;
    font-size: 9px;
}

.crm-automation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.crm-automation-grid article {
    min-height: 205px;
    padding: 25px 21px;
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: 12px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.crm-automation-grid article:hover {
    border-color: rgba(37, 99, 235, .32);
    box-shadow: 0 15px 32px rgba(16, 56, 101, .1);
    transform: translateY(-5px);
}

.crm-automation-grid article > i {
    display: grid;
    width: 43px;
    height: 43px;
    margin-bottom: 18px;
    color: #2878d6;
    background: #e9f3ff;
    border-radius: 10px;
    place-items: center;
}

.crm-automation-grid h3 {
    margin-bottom: 9px;
    font-size: 16px;
}

.crm-automation-grid p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Analytics */
.crm-analytics-ui {
    max-width: 1120px;
    margin: auto;
    padding: 28px;
    background: #fff;
    border: 1px solid #dce7f3;
    border-radius: 18px;
    box-shadow: 0 23px 55px rgba(15, 55, 99, .1);
}

.crm-analytics-top,
.crm-chart-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crm-analytics-top span:first-child {
    color: #2473d2;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.crm-analytics-top h3 {
    margin: 3px 0 0;
    font-size: 22px;
}

.crm-analytics-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 24px 0 12px;
}

.crm-analytics-metrics > span {
    display: grid;
    padding: 17px;
    background: #f7fafd;
    border: 1px solid #e5ecf4;
    border-radius: 9px;
}

.crm-analytics-metrics small {
    color: #7e8da1;
    font-size: 10px;
}

.crm-analytics-metrics b {
    margin: 4px 0;
    color: #193350;
    font-size: 21px;
}

.crm-analytics-metrics em {
    color: #0c9c68;
    font-size: 9px;
    font-style: normal;
}

.crm-analytics-charts {
    display: grid;
    grid-template-columns: 1.8fr .8fr;
    gap: 12px;
}

.crm-revenue-chart,
.crm-source-chart,
.crm-analytics-bottom > div {
    padding: 18px;
    background: #fff;
    border: 1px solid #e2eaf3;
    border-radius: 10px;
}

.crm-chart-title strong,
.crm-analytics-bottom strong {
    color: #203955;
    font-size: 12px;
}

.crm-chart-title span {
    color: #8190a3;
    font-size: 9px;
}

.crm-revenue-chart svg {
    width: 100%;
    height: 240px;
    margin-top: 6px;
}

.crm-revenue-chart g line {
    stroke: #e8eef5;
}

.crm-revenue-chart path:not(.forecast) {
    fill: none;
    stroke: #2477d7;
    stroke-width: 4;
}

.crm-revenue-chart .forecast {
    fill: rgba(37, 119, 215, .12);
    stroke: none;
}

.crm-big-donut {
    position: relative;
    display: grid;
    width: 125px;
    height: 125px;
    margin: 22px auto 14px;
    background: conic-gradient(#2477d7 0 42%, #7758ce 42% 70%, #18ab78 70% 88%, #ffad4e 88% 100%);
    border-radius: 50%;
    place-items: center;
}

.crm-big-donut::before {
    position: absolute;
    inset: 18px;
    content: "";
    background: #fff;
    border-radius: 50%;
}

.crm-big-donut span {
    position: relative;
    z-index: 1;
    color: #1a3552;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.crm-big-donut small {
    display: block;
    color: #8694a6;
    font-size: 7px;
}

.crm-source-chart ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.crm-source-chart li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 9px;
}

.crm-source-chart li i {
    width: 7px;
    height: 7px;
    background: #2477d7;
    border-radius: 50%;
}

.crm-source-chart li:nth-child(2) i { background: #7758ce; }
.crm-source-chart li:nth-child(3) i { background: #18ab78; }
.crm-source-chart li:nth-child(4) i { background: #ffad4e; }
.crm-source-chart li b { margin-left: auto; color: #203955; }

.crm-analytics-bottom {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr .7fr;
    gap: 12px;
    margin-top: 12px;
}

.crm-analytics-bottom > div {
    display: grid;
    gap: 10px;
}

.crm-analytics-bottom small {
    color: #8795a6;
    font-size: 8px;
}

.crm-analytics-bottom > div:last-child > b {
    color: #178d65;
    font-size: 31px;
}

.crm-winbar {
    height: 9px;
    overflow: hidden;
    background: #f2dada;
    border-radius: 9px;
}

.crm-winbar i {
    display: block;
    width: var(--w);
    height: 100%;
    background: #19a874;
    border-radius: inherit;
}

.crm-bars {
    display: flex;
    align-items: end;
    gap: 9px;
    height: 50px;
}

.crm-bars i {
    flex: 1;
    height: var(--h);
    background: linear-gradient(#45a8e7, #2375d5);
    border-radius: 3px 3px 0 0;
}

/* CRM and ERP integration */
.crm-product-flow {
    display: grid;
    grid-template-columns: 150px 1fr 90px 150px 1fr;
    align-items: center;
    gap: 18px;
    padding: 32px;
    background: #f7fafd;
    border: 1px solid #dce7f3;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 55, 99, .08);
}

.crm-product-label {
    display: grid;
    justify-items: center;
    padding: 25px 15px;
    color: #fff;
    background: linear-gradient(135deg, #1678dd, #0c55b6);
    border-radius: 14px;
    text-align: center;
}

.crm-product-label.erp {
    background: linear-gradient(135deg, #0c9a72, #087151);
}

.crm-product-label > i {
    margin-bottom: 11px;
    font-size: 26px;
}

.crm-product-label strong {
    font-size: 16px;
}

.crm-product-label small {
    margin-top: 3px;
    opacity: .75;
    font-size: 9px;
}

.crm-product-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.crm-product-steps span {
    display: grid;
    min-width: 74px;
    justify-items: center;
    gap: 8px;
    color: #29435f;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.crm-product-steps span i {
    display: grid;
    width: 42px;
    height: 42px;
    color: #2675d4;
    background: #e7f1fd;
    border-radius: 50%;
    place-items: center;
}

.crm-product-steps b {
    color: #9ab2cc;
    font-weight: 400;
}

.crm-integration-bridge {
    display: grid;
    justify-items: center;
    gap: 8px;
    color: #5f7892;
    text-align: center;
}

.crm-integration-bridge i {
    display: grid;
    width: 55px;
    height: 55px;
    color: #fff;
    font-size: 18px;
    background: linear-gradient(135deg, #2879d8, #0ba276);
    border-radius: 50%;
    box-shadow: 0 9px 24px rgba(27, 113, 175, .25);
    place-items: center;
}

.crm-integration-bridge small {
    font-size: 8px;
}

/* Why and final CTA */
.crm-why-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.crm-why-cards article {
    min-height: 205px;
    padding: 25px 20px;
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: 12px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.crm-why-cards article:hover {
    border-color: rgba(37, 99, 235, .32);
    box-shadow: 0 14px 32px rgba(16, 56, 101, .09);
    transform: translateY(-5px);
}

.crm-why-cards i {
    display: grid;
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
    color: #2475d3;
    background: #e8f3ff;
    border-radius: 10px;
    place-items: center;
}

.crm-why-cards h3 {
    margin-bottom: 9px;
    font-size: 15px;
}

.crm-why-cards p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.crm-page .crm-security .erp-security-grid span:last-child {
    grid-column: 1 / -1;
}

.crm-cta-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
}

.crm-cta-line i {
    width: 4px;
    height: 4px;
    background: #4fd2a1;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 1199px) {
    .crm-page .crm-hero .erp-hero-copy h1 { font-size: 50px; }
    .crm-profile-ui { grid-template-columns: 190px minmax(0, 1fr); }
    .crm-profile-side { display: none; }
    .crm-automation-grid { grid-template-columns: 1fr 1fr; }
    .crm-product-flow { grid-template-columns: 125px 1fr 70px 125px 1fr; gap: 10px; padding: 22px; }
    .crm-product-steps { gap: 4px; }
    .crm-product-steps span { min-width: 58px; font-size: 8px; }
    .crm-product-steps span i { width: 36px; height: 36px; }
    .crm-why-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
    .crm-page .crm-workflow .erp-flow { grid-template-columns: repeat(4, 1fr); }
    .crm-analytics-charts { grid-template-columns: 1fr; }
    .crm-product-flow { grid-template-columns: 130px 1fr; }
    .crm-integration-bridge { grid-column: 1 / -1; padding: 7px 0; }
    .crm-product-label.erp { grid-column: 1; }
}

@media (max-width: 767px) {
    .crm-page .crm-hero .erp-hero-copy h1 { font-size: 39px; }
    .crm-page .crm-challenge .erp-challenge-grid { grid-template-columns: 1fr; }
    .crm-page .crm-workflow .erp-flow { grid-template-columns: 1fr 1fr; }
    .crm-profile-ui { grid-template-columns: 1fr; }
    .crm-contact-list { display: flex; gap: 8px; overflow-x: auto; padding: 13px; }
    .crm-ui-search { display: none; }
    .crm-contact { flex: 0 0 175px; }
    .crm-profile-main { padding: 22px 17px; }
    .crm-profile-facts { grid-template-columns: 1fr; }
    .crm-profile-head { align-items: flex-start; }
    .crm-automation-grid { grid-template-columns: 1fr; }
    .crm-auto-flow { flex-wrap: wrap; }
    .crm-analytics-ui { padding: 18px; }
    .crm-analytics-top { align-items: flex-start; gap: 10px; }
    .crm-analytics-metrics { grid-template-columns: 1fr 1fr; }
    .crm-revenue-chart svg { height: 190px; }
    .crm-analytics-bottom { grid-template-columns: 1fr; }
    .crm-product-flow { grid-template-columns: 1fr; }
    .crm-product-label, .crm-product-label.erp, .crm-integration-bridge { grid-column: 1; }
    .crm-product-steps { flex-wrap: wrap; padding: 15px 0; }
    .crm-product-steps span { min-width: 64px; }
    .crm-why-cards { grid-template-columns: 1fr 1fr; }
    .crm-page .crm-security .erp-security-grid span:last-child { grid-column: auto; }
}

@media (max-width: 480px) {
    .crm-page .crm-hero .erp-hero-copy h1 { font-size: 35px; }
    .crm-profile-head { flex-wrap: wrap; }
    .crm-profile-head > div:nth-child(2) { min-width: calc(100% - 80px); }
    .crm-profile-head button { margin-left: auto; }
    .crm-analytics-metrics { grid-template-columns: 1fr; }
    .crm-why-cards { grid-template-columns: 1fr; }
}
