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

:root {
    --ladevi-blue: #021F70;
    --ladevi-orange: #F9A11B;
    --ink: #111827;
    --muted: #69758f;
    --line: #dfe6f1;
    --surface: #ffffff;
    --surface-soft: #f7f9fd;
    --bg: #eef3f8;
    --danger: #e74c3c;
    --radius: 8px;
    --gap: 16px;
    --shadow-card: 0 18px 45px rgba(13, 36, 86, 0.10);
    --shadow-soft: 0 8px 24px rgba(13, 36, 86, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
}

body {
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(2, 31, 112, 0.06), transparent 320px),
        var(--bg);
}

img,
canvas,
iframe {
    display: block;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: minmax(0, 70%) minmax(280px, 30%);
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.report-stage {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
    height: 100vh;
    padding: 22px 30px 28px;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand-strip {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) minmax(260px, 30%);
    align-items: stretch;
    gap: 22px;
    min-width: 0;
}

.brand-strip .database-card {
    grid-column: 3;
    grid-row: 1;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    height: 100%;
    padding: 20px;
    border: 1px solid rgba(2, 31, 112, 0.08);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.main-logo {
    width: 100%;
    max-width: 230px;
    height: auto;
    object-fit: contain;
}

.report-kicker {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 92px;
    height: 100%;
    padding: 20px 26px;
    border-radius: var(--radius);
    color: #ffffff;
    background: var(--ladevi-blue);
    box-shadow: var(--shadow-card);
}

.report-kicker span {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.report-kicker strong {
    margin-top: 4px;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
    font-weight: 800;
    line-height: 1.1;
}

.campaign-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    min-width: 0;
}

.campaign-main,
.database-card,
.powered-card,
.impact-card,
.month-card,
.global-band {
    border: 1px solid rgba(2, 31, 112, 0.08);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.campaign-main {
    position: relative;
    min-width: 0;
    padding: 26px 30px;
    overflow: visible;
}

.campaign-main::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: var(--ladevi-orange);
}

.campaign-pill-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    margin-bottom: 16px;
    min-width: 0;
}

.campaign-pill-row span {
    min-width: 0;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.82rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.campaign-pill-row .sender-pill {
    width: 100%;
    white-space: normal;
    line-height: 1.35;
}

.campaign-pill-row .client-pill,
.campaign-pill-row .date-pill {
    white-space: nowrap;
}

.campaign-pill-row strong {
    color: var(--ladevi-blue);
}

.campaign-main h1 {
    width: 100%;
    max-width: none;
    color: var(--ink);
    font-size: clamp(0.88rem, 1.12vw, 1.12rem);
    line-height: 1.34;
    font-weight: 700;
    letter-spacing: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.campaign-subject {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 5px;
    row-gap: 2px;
    align-items: baseline;
}

.campaign-main h1 strong {
    color: var(--ladevi-blue);
}

.campaign-main h1 span {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.campaign-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    min-width: 0;
}

.database-card,
.powered-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 92px;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 14px;
    text-align: center;
    overflow: hidden;
}

.database-card::before,
.powered-card::before,
.impact-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: var(--ladevi-blue);
}

.clicks-card::before,
.engagement-card::before,
.footer-powered-card::before {
    background: var(--ladevi-orange);
}

.timeline-card::before {
    background: var(--ladevi-orange);
}

.engagement-card::before {
    background: var(--ladevi-blue);
}

.eyebrow {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.database-card strong {
    max-width: 100%;
    margin-top: 8px;
    color: var(--ladevi-blue);
    font-size: clamp(1.05rem, 1.45vw, 1.45rem);
    line-height: 1.05;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.database-card small {
    margin-top: 6px;
    color: var(--ladevi-orange);
    font-size: 0.82rem;
    font-weight: 800;
}

.emm-logo-xl {
    width: 100%;
    max-width: 115px;
    height: auto;
    margin-top: 10px;
    object-fit: contain;
}

.report-footer {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 26px;
    padding: 0 0 34px;
    background: var(--bg);
}

.footer-powered-card {
    width: 100%;
    min-height: 132px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 -10px 34px rgba(13, 36, 86, 0.06);
}

.footer-powered-card::before {
    display: none;
}

.kpi-grid,
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    min-width: 0;
}

.impact-card {
    position: relative;
    min-width: 0;
    padding: 18px 20px 18px 26px;
    overflow: hidden;
}

.kpi-card {
    position: relative;
    min-height: 170px;
    overflow: hidden;
}

.card-label,
.section-heading,
.product-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.card-label i,
.section-heading i,
.product-heading i {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff;
    background: var(--ladevi-blue);
    font-size: 0.92rem;
}

.clicks-card .card-label i,
.timeline-card .section-heading i,
.eblast-color i {
    background: var(--ladevi-orange);
}

.enews-color i {
    background: var(--ladevi-blue);
}

.card-label span,
.section-heading h2,
.product-heading h2 {
    color: var(--ladevi-blue);
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.timeline-card .section-heading h2 {
    color: var(--ladevi-orange);
}

.kpi-content {
    display: grid;
    grid-template-columns: minmax(120px, 32%) minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    margin-top: 18px;
}

.kpi-content strong {
    color: var(--ladevi-blue);
    font-size: clamp(2.25rem, 5vw, 4.4rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0;
}

.clicks-card .kpi-content strong {
    color: var(--ladevi-orange);
}

.chart-mini-container {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 94px;
}

.timeline-card,
.engagement-card {
    min-height: 285px;
}

.chart-wide-container {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 220px;
    margin-top: 18px;
}

.engagement-layout {
    display: grid;
    grid-template-columns: minmax(150px, 36%) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-width: 0;
    margin-top: 18px;
}

.engagement-list {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.eng-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.eng-item strong {
    color: var(--ink);
    white-space: nowrap;
}

.text-blue {
    color: var(--ladevi-blue) !important;
}

.text-orange {
    color: var(--ladevi-orange) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.donut-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(22px, 3vw, 42px);
    min-width: 0;
    min-height: 180px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.donut-wrapper {
    position: relative;
    flex: 0 0 auto;
    text-align: center;
}

.donut-wrapper.opened {
    width: 148px;
    height: 148px;
}

.donut-wrapper.clicks {
    width: 108px;
    height: 108px;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    color: var(--ink);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    transform: translate(-50%, -56%);
}

.donut-center-text.small {
    font-size: 1rem;
}

.donut-sub {
    position: absolute;
    right: 0;
    bottom: -24px;
    left: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-align: center;
    text-transform: uppercase;
}

.global-band {
    display: grid;
    grid-template-columns: minmax(220px, 36%) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    background:
        linear-gradient(90deg, rgba(2, 31, 112, 0.96), rgba(2, 31, 112, 0.86)),
        var(--ladevi-blue);
    color: #ffffff;
}

.global-band .eyebrow {
    color: rgba(255, 255, 255, 0.64);
}

.global-band h2 {
    margin-top: 3px;
    font-size: clamp(1.18rem, 2vw, 1.65rem);
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
}

.global-band p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
}

.product-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-heading {
    margin-top: 4px;
}

.enews-color h2 {
    color: var(--ladevi-blue);
}

.eblast-color h2 {
    color: var(--ladevi-orange);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
    min-width: 0;
}

.month-card {
    position: relative;
    min-width: 0;
    padding: 20px;
    overflow: hidden;
}

.month-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--ladevi-blue);
}

.month-card.highlighted {
    border-color: rgba(249, 161, 27, 0.38);
    background: #fffaf0;
}

.month-card.highlighted::before {
    background: var(--ladevi-orange);
}

.month-label {
    margin-bottom: 16px;
    color: var(--ladevi-blue);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.m-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.m-stat strong {
    color: var(--ladevi-blue);
    font-size: 1.02rem;
    text-align: right;
    white-space: nowrap;
}

.m-progress-group {
    margin-top: 14px;
}

.m-progress-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 600;
}

.m-progress-label strong {
    margin-left: auto;
    white-space: nowrap;
}

.m-progress-label small {
    color: var(--ladevi-orange);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.m-bar {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf6;
}

.m-fill {
    height: 100%;
    border-radius: 999px;
}

.m-fill.blue {
    background: var(--ladevi-blue);
}

.m-fill.orange {
    background: var(--ladevi-orange);
}

.m-fill.danger {
    background: var(--danger);
}

.mailing-preview {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    padding: 16px 16px 16px 0;
    background: #dfe6f1;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    border-radius: var(--radius) var(--radius) 0 0;
    color: #ffffff;
    background: var(--ladevi-blue);
    box-shadow: var(--shadow-soft);
}

.preview-header span {
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.artwork-content {
    position: relative;
    flex: 1;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    border: 1px solid rgba(2, 31, 112, 0.16);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.artwork-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

#previewIframe {
    position: absolute;
    top: 0;
    left: 0;
    border: none;
    transform-origin: top left;
}

@media (max-width: 1450px) {
    .report-stage {
        gap: 12px;
        padding: 16px 22px 22px;
    }

    .brand-strip {
        grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) minmax(230px, 29%);
        gap: 12px;
    }

    .brand-mark,
    .report-kicker {
        min-height: 74px;
        padding: 14px 18px;
    }

    .main-logo {
        max-width: 170px;
    }

    .report-kicker strong {
        font-size: 1.15rem;
    }

    .campaign-main {
        padding: 20px 24px;
    }

    .campaign-pill-row {
        gap: 6px;
        margin-bottom: 10px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .campaign-pill-row span {
        padding: 5px 9px;
        font-size: 0.68rem;
    }

    .campaign-main h1 {
        font-size: 0.8rem;
        line-height: 1.28;
    }

    .database-card,
    .powered-card {
        min-height: 74px;
        padding: 14px 12px 14px 18px;
    }

    .database-card strong {
        font-size: clamp(0.98rem, 1.35vw, 1.22rem);
    }

    .emm-logo-xl {
        max-width: 92px;
    }

    .impact-card {
        padding: 16px 16px 16px 22px;
    }

    .kpi-card {
        min-height: 140px;
    }

    .kpi-content {
        gap: 12px;
        margin-top: 12px;
    }

    .kpi-content strong {
        font-size: 2.25rem;
    }

    .chart-mini-container {
        height: 74px;
    }

    .timeline-card,
    .engagement-card {
        min-height: 238px;
    }

    .chart-wide-container {
        height: 170px;
        margin-top: 12px;
    }

    .engagement-layout {
        gap: 12px;
        margin-top: 12px;
    }

    .eng-item {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .donut-stage {
        min-height: 150px;
        gap: 22px;
        padding: 10px;
    }

    .donut-wrapper.opened {
        width: 118px;
        height: 118px;
    }

    .donut-wrapper.clicks {
        width: 86px;
        height: 86px;
    }

    .global-band {
        padding: 18px 22px;
    }

    .month-card {
        padding: 16px;
    }

    .month-label {
        margin-bottom: 12px;
        font-size: 0.9rem;
    }

    .m-stat,
    .m-progress-label {
        font-size: 0.76rem;
    }

    .m-stat strong {
        font-size: 0.88rem;
    }
}

@media (max-width: 1300px) {
    .dashboard-shell {
        display: block;
        height: auto;
        overflow: visible;
    }

    .report-stage {
        height: auto;
        overflow: visible;
    }

    .mailing-preview {
        width: 100%;
        height: auto;
        min-height: 0;
        max-width: none;
        margin: 0;
        padding: 0 22px 22px;
        background: var(--bg);
    }

    .preview-header,
    .artwork-content {
        width: 100%;
        max-width: 800px;
        margin-right: auto;
        margin-left: auto;
    }

    .artwork-content {
        flex: 0 0 auto;
    }
}

@media (max-width: 1024px) {
    .dashboard-shell {
        display: block;
        height: auto;
        overflow: visible;
    }

    .report-stage {
        height: auto;
        padding: 15px;
        overflow: visible;
    }

    .brand-strip,
    .campaign-hero,
    .campaign-side,
    .kpi-grid,
    .analysis-grid,
    .global-band,
    .month-grid {
        grid-template-columns: 1fr;
    }

    .brand-strip,
    .campaign-main,
    .global-band {
        text-align: center;
    }

    .campaign-pill-row {
        justify-content: center;
        grid-template-columns: 1fr;
    }

    .campaign-subject {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .database-card,
    .powered-card {
        min-height: 112px;
    }

    .kpi-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .chart-mini-container {
        height: 120px;
    }

    .engagement-layout {
        grid-template-columns: 1fr;
    }

    .donut-stage {
        min-height: 220px;
        padding-bottom: 34px;
    }

    .mailing-preview {
        height: auto;
        min-height: 0;
        max-width: none;
        margin: 0;
        padding: 0 15px 15px;
        background: var(--bg);
    }

    .report-footer {
        margin-top: 20px;
        padding: 0 0 24px;
    }
}

@media (max-width: 640px) {
    .report-stage {
        padding: 12px;
    }

    .brand-strip {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
    }

    .brand-mark {
        grid-column: 1 / -1;
        min-height: 84px;
        padding: 14px 18px;
    }

    .brand-strip .database-card {
        grid-column: auto;
        grid-row: auto;
    }

    .main-logo {
        max-width: 210px;
    }

    .report-kicker,
    .campaign-main,
    .impact-card,
    .month-card,
    .global-band {
        padding: 16px;
    }

    .campaign-side {
        grid-template-columns: 1fr;
    }

    .card-label,
    .section-heading,
    .product-heading {
        align-items: flex-start;
    }

    .card-label span,
    .section-heading h2,
    .product-heading h2 {
        font-size: 0.78rem;
    }

    .chart-wide-container {
        height: 190px;
    }

    .donut-stage {
        flex-direction: column;
        gap: 54px;
        padding: 18px 12px 46px;
    }

    .global-band p {
        font-size: 0.82rem;
    }

    .m-progress-label {
        flex-wrap: wrap;
    }

    .m-progress-label strong {
        margin-left: 0;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #bac6d7;
}
