:root {
    color-scheme: light;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
    --topbar-sticky-offset: 24px;
    --shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.leads-prioritization-section {
    margin: 0 0 24px;
    padding: 20px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 16px;
    background: #111827;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    overflow-x: auto;
}

.leads-prioritization-section .flex {
    display: flex;
}

.leads-prioritization-section .items-center {
    align-items: center;
}

.leads-prioritization-section .justify-between {
    justify-content: space-between;
}

.leads-prioritization-section .gap-1 {
    gap: 4px;
}

.leads-prioritization-section .gap-2 {
    gap: 8px;
}

.leads-prioritization-section .gap-3 {
    gap: 12px;
}

.leads-prioritization-section .mb-4 {
    margin-bottom: 16px;
}

.leads-prioritization-section .mt-4 {
    margin-top: 16px;
}

.leads-prioritization-section select,
.leads-prioritization-section input {
    min-height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: #1f2937;
    color: #e5e7eb;
    font: inherit;
    font-size: 0.85rem;
    padding: 8px 12px;
    outline: none;
}

.leads-prioritization-section input::placeholder {
    color: #9ca3af;
}

.leads-prioritization-section select:focus,
.leads-prioritization-section input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.leads-prioritization-section button {
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
}

.leads-prioritization-section button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.leads-prioritization-section table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    table-layout: auto;
}

.leads-prioritization-section th {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.leads-prioritization-section td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    color: #e5e7eb;
    font-size: 0.86rem;
    overflow-wrap: normal;
    vertical-align: middle;
}

.leads-prioritization-section th:first-child,
.leads-prioritization-section td:first-child {
    width: 150px;
    min-width: 150px;
}

.leads-prioritization-section th:nth-child(2),
.leads-prioritization-section td:nth-child(2) {
    width: 150px;
    min-width: 150px;
}

.leads-prioritization-section th:nth-child(3),
.leads-prioritization-section td:nth-child(3) {
    width: 340px;
    min-width: 340px;
}

.leads-prioritization-section td:nth-child(6),
.leads-prioritization-section td:nth-child(8),
.leads-prioritization-section th:nth-child(6),
.leads-prioritization-section th:nth-child(8) {
    text-align: center;
}

.leads-prioritization-section tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.leads-prioritization-section tbody tr,
.leads-prioritization-section tbody td:first-child {
    cursor: pointer;
}

.leads-prioritization-section p {
    margin: 0;
}

.leads-prioritization-section .w-8 {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
}

.leads-prioritization-section .text-white,
.leads-prioritization-section .font-medium {
    color: #f8fafc;
}

.leads-prioritization-section .text-surface-500,
.leads-prioritization-section .text-surface-400,
.leads-prioritization-section .text-surface-300 {
    color: #94a3b8;
}

.leads-prioritization-section td:first-child .text-surface-500 {
    color: #cbd5e1;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

.leads-prioritization-section .score-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.leads-prioritization-section .tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
    font-weight: 800;
}

.leads-prioritization-section .bg-emerald-500\/20 {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.leads-prioritization-section .bg-amber-500\/20 {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.leads-prioritization-section .bg-red-500\/20 {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

.leads-prioritization-section .bg-gian-500\/20 {
    background: rgba(37, 99, 235, 0.14);
    color: #60a5fa;
}

.leads-prioritization-section .bg-violet-500\/20 {
    background: rgba(139, 92, 246, 0.14);
    color: #a78bfa;
}

#leads-pagination {
    color: #cbd5e1;
    font-size: 0.84rem;
}

#leads-pagination .is-active-page {
    background: #2563eb;
}

.leads-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: #0f172a;
}

.leads-table-filters {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(160px, 190px) minmax(240px, 1fr);
    gap: 10px;
    min-width: 1120px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.leads-table-filters.topbar__lead-filters input,
.leads-table-filters.topbar__lead-filters select {
    width: 100%;
    min-width: 0;
}

.leads-prioritization-section td button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
}

.leads-prioritization-section td button:hover {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}

.leads-prioritization-section td button svg {
    width: 16px;
    height: 16px;
}

.lead-detail-section {
    color: #f8fafc;
}

.lead-detail-section[hidden] {
    display: none;
}

.lead-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    border: 0;
    background: transparent;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.lead-detail__back:hover {
    color: #60a5fa;
}

.lead-detail__back svg {
    width: 18px;
    height: 18px;
}

.lead-detail__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
    gap: 20px;
}

.lead-detail__main,
.lead-detail__side {
    display: grid;
    align-content: start;
    gap: 20px;
}

.lead-detail-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 24px;
}

.lead-detail-card h3 {
    margin: 0 0 18px;
    color: #fff;
    font-size: 1rem;
}

.lead-detail-card--hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 26px;
}

.lead-profile {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 20px;
}

.lead-profile__avatar {
    display: flex;
    width: 70px;
    height: 70px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
}

.lead-profile h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1.16;
}

.lead-profile p,
.lead-profile span {
    display: block;
    margin: 0;
    color: #93a4bd;
    line-height: 1.45;
}

.lead-profile span {
    color: #64748b;
    font-size: 0.88rem;
}

.lead-profile__actions {
    display: flex;
    gap: 10px;
}

.lead-profile__actions button,
.lead-quick-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.lead-profile__actions button {
    gap: 8px;
    padding: 0 14px;
}

.lead-profile__actions svg {
    width: 16px;
    height: 16px;
}

.lead-profile__actions .lead-button--muted {
    background: #334155;
}

.lead-pipeline {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.lead-pipeline>span {
    color: #7e92b3;
    font-size: 0.9rem;
}

.lead-pipeline__bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.lead-pipeline__bar i {
    height: 9px;
    border-radius: 999px;
    background: #263247;
}

.lead-pipeline__bar i.is-active {
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
}

.lead-pipeline__labels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    color: #526781;
    font-size: 0.75rem;
}

.lead-pipeline__labels span:nth-child(2),
.lead-pipeline__labels span:nth-child(3),
.lead-pipeline__labels span:nth-child(4) {
    text-align: center;
}

.lead-pipeline__labels span:last-child {
    text-align: right;
}

.lead-pipeline__labels .is-current {
    color: #38bdf8;
    font-weight: 800;
}

.lead-score-card {
    display: grid;
}

.lead-score-ring {
    display: flex;
    width: 120px;
    height: 120px;
    align-items: center;
    justify-content: center;
    justify-self: center;
    margin: 0 0 20px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #111827 58%, transparent 59%),
        conic-gradient(#10b981 calc(var(--score) * 1%),
            rgba(16, 185, 129, 0.14) 0);
    color: #34d399;
    font-size: 2.2rem;
    font-weight: 900;
}

.lead-score-list,
.lead-info-list {
    display: grid;
    gap: 13px;
    margin: 0;
}

.lead-score-list div,
.lead-info-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.lead-score-list dt,
.lead-info-list dt {
    color: #7e92b3;
}

.lead-score-list dd,
.lead-info-list dd {
    margin: 0;
    color: #fff;
    font-weight: 800;
    text-align: right;
}

.lead-history {
    display: grid;
    gap: 18px;
}

.lead-history__item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.lead-history__icon {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #1f2937;
}

.lead-history__icon svg {
    width: 18px;
    height: 18px;
}

.lead-history__icon--purple {
    color: #a78bfa;
}

.lead-history__icon--amber,
.lead-history__icon--yellow {
    color: #facc15;
}

.lead-history__icon--green {
    color: #34d399;
}

.lead-history__icon--blue {
    color: #60a5fa;
}

.lead-history__item strong {
    display: block;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
}

.lead-history__item time {
    display: block;
    margin-top: 4px;
    color: #526781;
    font-size: 0.82rem;
}

.lead-quick-actions {
    display: grid;
    gap: 10px;
}

.lead-quick-actions button {
    width: 100%;
    background: #17376d;
    color: #38a8ff;
    padding: 0 14px;
}

.lead-quick-actions button:nth-child(2) {
    background: #0f3e42;
    color: #20f2a6;
}

.lead-quick-actions button:nth-child(3) {
    background: #1f2937;
    color: #e5e7eb;
}

@media (max-width: 1120px) {
    .lead-detail__layout {
        grid-template-columns: 1fr;
    }

    .lead-detail__side {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {

    .lead-detail-card--hero,
    .lead-profile,
    .lead-profile__actions {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .lead-detail-card--hero {
        display: grid;
    }

    .lead-profile__actions {
        display: grid;
        width: 100%;
    }

    .lead-profile {
        flex-direction: column;
    }

    .lead-detail__side {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .leads-prioritization-section {
        padding: 16px;
        overflow: hidden;
    }

    .leads-prioritization-section .justify-between,
    #leads-pagination {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .leads-prioritization-section .justify-between>.flex {
        flex-direction: column;
    }

    .leads-prioritization-section select,
    .leads-prioritization-section input {
        width: 100%;
    }

    .topbar__lead-filters,
    .topbar__lead-filters select,
    .topbar__lead-filters input {
        width: 100%;
    }

    .topbar__lead-filters select,
    .topbar__lead-filters input {
        min-width: 0;
    }

    .leads-table-filters {
        grid-template-columns: 1fr;
        min-width: 0;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid rgba(148, 163, 184, 0.18);
        border-radius: 12px;
        background: #0f172a;
    }

    .leads-table-wrap {
        overflow-x: visible;
        border: 0;
        background: transparent;
    }

    .leads-prioritization-section table,
    .leads-prioritization-section tbody,
    .leads-prioritization-section tr,
    .leads-prioritization-section td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .leads-prioritization-section table {
        min-width: 0;
    }

    .leads-prioritization-section thead {
        display: none;
    }

    .leads-prioritization-section tbody {
        display: grid;
        gap: 12px;
    }

    .leads-prioritization-section tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding: 14px;
        border: 1px solid rgba(148, 163, 184, 0.18);
        border-radius: 12px;
        background: #0f172a;
    }

    .leads-prioritization-section td {
        padding: 0;
        border-bottom: 0;
        white-space: normal;
    }

    .leads-prioritization-section td::before {
        content: "";
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .leads-prioritization-section td:first-child,
    .leads-prioritization-section td:nth-child(2),
    .leads-prioritization-section td:nth-child(3),
    .leads-prioritization-section td:nth-child(4),
    .leads-prioritization-section td:nth-child(5),
    .leads-prioritization-section td:nth-child(7) {
        grid-column: 1 / -1;
    }

    .leads-prioritization-section td:first-child::before {
        content: "Campa\00f1 a";
    }

    .leads-prioritization-section td:nth-child(2)::before {
        content: "Empresa";
    }

    .leads-prioritization-section td:nth-child(3)::before {
        content: "Contacto";
    }

    .leads-prioritization-section td:nth-child(4)::before {
        content: "Cargo";
    }

    .leads-prioritization-section td:nth-child(5)::before {
        content: "Tamano";
    }

    .leads-prioritization-section td:nth-child(6)::before {
        content: "Score";
    }

    .leads-prioritization-section td:nth-child(7)::before {
        content: "Estado";
    }

    .leads-prioritization-section td:nth-child(8)::before {
        content: "Accion";
    }

    .leads-prioritization-section td:first-child,
    .leads-prioritization-section td:nth-child(2),
    .leads-prioritization-section td:nth-child(3) p {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .leads-prioritization-section td:nth-child(6),
    .leads-prioritization-section td:nth-child(8) {
        align-self: end;
        justify-self: stretch;
        text-align: left;
    }

    #leads-pagination .flex {
        flex-wrap: wrap;
    }

    #leads-pagination button {
        flex: 1 1 auto;
    }

    .company-profile-modal__identity,
    .company-profile-modal__body {
        grid-template-columns: 1fr;
    }

    .company-profile-modal__identity img {
        width: 76px;
    }

    .company-profile-facts div {
        display: grid;
        gap: 4px;
    }

    .company-profile-facts dd {
        min-width: 0;
        text-align: left;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .lead-detail-card {
        padding: 18px;
    }

    .lead-profile__avatar {
        width: 56px;
        height: 56px;
        border-radius: 14px;
        font-size: 1.05rem;
    }

    .lead-profile h2 {
        font-size: 1.25rem;
    }

    .lead-pipeline__labels {
        font-size: 0.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .lead-widget,
    .lead-ai-insight::after,
    .lead-ai-insight svg,
    .lead-widget--diagnosis::before,
    .lead-diagnosis-card,
    .lead-diagnosis-card::after,
    .lead-diagnosis-card li {
        animation: none;
        transition: none;
    }

    .lead-widget:hover,
    .lead-diagnosis-card:hover {
        transform: none;
    }
}

.lead-detail-dashboard {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.35fr) minmax(280px,
            0.9fr);
    grid-template-areas:
        "profile profile profile"
        "score diagnosis context"
        "score intelligence opportunity"
        "contacts contacts history";
    gap: 16px;
}

.lead-widget {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.015)),
        #101524;
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.18);
    color: #e5e7eb;
    padding: 18px;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
    animation: leadWidgetReveal 0.46s ease both;
}

.lead-detail-dashboard .lead-widget:nth-child(2) {
    animation-delay: 0.04s;
}

.lead-detail-dashboard .lead-widget:nth-child(3) {
    animation-delay: 0.08s;
}

.lead-detail-dashboard .lead-widget:nth-child(4) {
    animation-delay: 0.12s;
}

.lead-detail-dashboard .lead-widget:nth-child(n + 5) {
    animation-delay: 0.16s;
}

.lead-widget:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 22px 52px rgba(2, 6, 23, 0.23);
}

.lead-widget h3,
.lead-widget h4,
.lead-widget p,
.lead-widget dl,
.lead-widget ul {
    margin: 0;
}

.lead-widget h3 {
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.2;
}

.lead-widget--profile {
    grid-area: profile;
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.12fr);
    align-items: stretch;
    gap: 24px;
    padding: 22px;
}

.lead-company {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
}

.lead-company__logo {
    display: grid;
    width: 86px;
    height: 86px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 18px;
    background: linear-gradient(145deg, #f8fafc, #dbeafe);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    color: #2563eb;
    font-size: 1.45rem;
    font-weight: 900;
}

.lead-company__body {
    min-width: 0;
}

.lead-company__title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.lead-company__title-row h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.05;
}

.lead-status-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 9px;
}

.lead-company__body p {
    color: #b7c2d4;
    font-size: 0.88rem;
}

.lead-company__meta,
.lead-company__links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    color: #b7c2d4;
    font-size: 0.82rem;
}

.lead-company__links {
    color: #60a5fa;
}

.lead-company__meta span,
.lead-company__links span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lead-company__meta svg,
.lead-company__links svg {
    width: 14px;
    height: 14px;
}

.lead-company__links .lead-linkedin-badge {
    display: inline-grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border-radius: 3px;
    background: #60a5fa;
    color: #0f172a;
    font-family: Arial, sans-serif;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.lead-profile-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.lead-profile-metrics div {
    display: grid;
    grid-template-rows: 40px 32px 22px;
    align-content: center;
    align-items: start;
    gap: 7px;
    min-height: 98px;
    padding: 0 28px;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.lead-profile-metrics div:last-child {
    border-right: 0;
}

.lead-profile-metrics span {
    color: #aab8cc;
    font-size: 0.88rem;
    line-height: 1.18;
}

.lead-profile-metrics strong {
    color: #f8fafc;
    font-size: 1.58rem;
    line-height: 1;
}

.lead-profile-metrics em {
    color: #4ade80;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 800;
    line-height: 1.1;
}

.lead-widget--score {
    grid-area: score;
}

.lead-score-summary {
    display: grid;
    grid-template-columns: minmax(104px, 118px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 18px;
    overflow: hidden;
}

.lead-detail-dashboard .lead-score-ring {
    display: grid;
    width: min(118px, 100%);
    aspect-ratio: 1;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #101524 54%, transparent 55%),
        conic-gradient(#38e074 calc(var(--score) * 1%),
            rgba(56, 224, 116, 0.14) 0);
    color: #38e074;
}

.lead-detail-dashboard .lead-score-ring strong {
    font-size: 2rem;
    line-height: 1;
}

.lead-detail-dashboard .lead-score-ring span {
    color: #f8fafc;
    font-size: 0.76rem;
}

.lead-detail-dashboard .lead-score-list {
    display: grid;
    gap: 9px;
    margin: 0;
    min-width: 0;
    padding-right: 0;
}

.lead-detail-dashboard .lead-score-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding-bottom: 8px;
}

.lead-detail-dashboard .lead-score-list dt {
    display: inline-flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    color: #d6deea;
    font-size: 0.8rem;
    line-height: 1.25;
}

.lead-detail-dashboard .lead-score-list dt svg {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    color: #60a5fa;
}

.lead-detail-dashboard .lead-score-list dd {
    flex: 0 0 38px;
    min-width: 38px;
    margin: 0;
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 900;
    text-align: right;
}

.lead-ai-insight {
    position: relative;
    overflow: hidden;
    margin-top: 18px;
    border: 1px solid rgba(16, 185, 129, 0.24);
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.08);
    padding: 14px;
}

.lead-ai-insight::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 0%,
            rgba(134, 239, 172, 0.16) 46%,
            transparent 72%);
    content: "";
    transform: translateX(-120%);
    animation: aiInsightScan 4.8s ease-in-out infinite;
    pointer-events: none;
}

.lead-ai-insight strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #86efac;
    font-size: 0.86rem;
}

.lead-ai-insight svg {
    width: 16px;
    height: 16px;
    animation: aiSpark 1.8s ease-in-out infinite;
}

.lead-ai-insight p {
    margin-top: 8px;
    color: #f8fafc;
    font-size: 0.82rem;
    line-height: 1.55;
}

.lead-widget--diagnosis {
    grid-area: diagnosis;
    overflow: hidden;
    border-color: rgba(96, 165, 250, 0.22);
    background:
        radial-gradient(circle at 18% 0%,
            rgba(59, 130, 246, 0.16),
            transparent 32%),
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.014)),
        #101524;
}

.lead-widget--diagnosis::before {
    position: absolute;
    top: 0;
    left: -45%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(96, 165, 250, 0.12),
            transparent);
    content: "";
    transform: skewX(-18deg);
    animation: diagnosisSweep 5.6s ease-in-out infinite;
    pointer-events: none;
}

.lead-diagnosis-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.lead-diagnosis-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    padding: 14px;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.lead-diagnosis-card:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, 0.3);
}

.lead-diagnosis-card::after {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.42);
    content: "";
    animation: aiStatusPulse 2.2s ease-out infinite;
}

.lead-diagnosis-card--red {
    background: rgba(239, 68, 68, 0.08);
}

.lead-diagnosis-card--green {
    background: rgba(16, 185, 129, 0.08);
}

.lead-diagnosis-card--amber {
    background: rgba(245, 158, 11, 0.08);
}

.lead-diagnosis-card h4 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    color: #fca5a5;
    font-size: 0.78rem;
}

.lead-diagnosis-card--green h4 {
    color: #86efac;
}

.lead-diagnosis-card--amber h4 {
    color: #fcd34d;
}

.lead-diagnosis-card h4 svg {
    width: 15px;
    height: 15px;
}

.lead-diagnosis-card ul,
.lead-intel-grid ul {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.lead-diagnosis-card li,
.lead-intel-grid li {
    position: relative;
    padding-left: 13px;
    color: #e5e7eb;
    font-size: 0.78rem;
    line-height: 1.45;
    animation: leadTextResolve 0.42s ease both;
}

.lead-diagnosis-card li:nth-child(2) {
    animation-delay: 0.08s;
}

.lead-diagnosis-card li:nth-child(3) {
    animation-delay: 0.16s;
}

.lead-diagnosis-card li:nth-child(4) {
    animation-delay: 0.24s;
}

.lead-diagnosis-card li::before,
.lead-intel-grid li::before {
    position: absolute;
    left: 0;
    color: #60a5fa;
    content: "*";
}

.lead-widget--context {
    grid-area: context;
}

.lead-widget--context h3 {
    margin-bottom: 22px;
}

.lead-context-list {
    display: grid;
    gap: 16px;
    margin-top: 0;
}

.lead-context-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.lead-context-list dt {
    color: #bbc7d8;
    font-size: 0.86rem;
}

.lead-context-list dd {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #f8fafc;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.lead-context-list dd.lead-context-link {
    color: #60a5fa;
}

.lead-context-list dd svg {
    width: 13px;
    height: 13px;
    color: #60a5fa;
}

@keyframes leadWidgetReveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aiInsightScan {

    0%,
    62% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(120%);
    }
}

@keyframes aiSpark {

    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(134, 239, 172, 0));
        transform: rotate(0deg) scale(1);
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(134, 239, 172, 0.55));
        transform: rotate(8deg) scale(1.08);
    }
}

@keyframes diagnosisSweep {

    0%,
    58% {
        left: -45%;
    }

    100% {
        left: 112%;
    }
}

@keyframes aiStatusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.42);
    }

    70% {
        box-shadow: 0 0 0 9px rgba(96, 165, 250, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
    }
}

@keyframes leadTextResolve {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lead-widget--intelligence {
    grid-area: intelligence;
}

.lead-intel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.lead-intel-grid section {
    min-width: 0;
    min-height: 112px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.48);
    padding: 14px;
    overflow: hidden;
}

.lead-intel-grid h4 {
    color: #f8fafc;
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.lead-intel-grid p,
.lead-intel-grid span {
    color: #d9e2ef;
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: normal;
}

.lead-intel-grid p {
    margin-top: 14px;
}

.lead-intel-grid p svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    color: #60a5fa;
    vertical-align: middle;
}

.lead-intel-grid strong,
.lead-intel-grid span {
    color: #86efac;
}

.lead-sparkline {
    width: 82px;
    height: 34px;
    margin: 20px 0 7px;
    background:
        linear-gradient(135deg, transparent 48%, #22c55e 50%, transparent 53%),
        linear-gradient(20deg, transparent 45%, #60a5fa 47%, transparent 50%);
}

.lead-widget--opportunity {
    grid-area: opportunity;
}

.lead-opportunity-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.lead-opportunity-metrics div {
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.lead-opportunity-metrics div:last-child {
    border-right: 0;
}

.lead-opportunity-metrics span {
    display: block;
    color: #aab8cc;
    font-size: 0.78rem;
}

.lead-opportunity-metrics strong {
    display: block;
    margin-top: 6px;
    color: #f8fafc;
    font-size: 1.18rem;
}

.lead-opportunity-metrics div:last-child strong {
    color: #4ade80;
}

.lead-area-chart {
    position: relative;
    height: 112px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.48)),
        repeating-linear-gradient(0deg,
            rgba(148, 163, 184, 0.08) 0 1px,
            transparent 1px 24px),
        rgba(15, 23, 42, 0.36);
}

.lead-area-chart svg {
    position: absolute;
    inset: 10px 12px 8px;
    width: calc(100% - 24px);
    height: calc(100% - 18px);
}

.lead-area-chart__fill {
    fill: url("#leadOpportunityFill");
}

.lead-area-chart__line {
    fill: none;
    stroke: url("#leadOpportunityLine");
    stroke-linecap: round;
    stroke-width: 4;
}

.lead-area-chart span {
    position: absolute;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border: 2px solid #c084fc;
    border-radius: 50%;
    background: #f8fafc;
    box-shadow:
        0 0 0 4px rgba(168, 85, 247, 0.18),
        0 8px 18px rgba(2, 6, 23, 0.26);
}

.lead-widget--contacts {
    grid-area: contacts;
}

.lead-contacts-table {
    margin-top: 16px;
    overflow-x: auto;
}

.lead-contacts-table__head,
.lead-contact-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) 86px 86px 128px 64px 62px;
    align-items: center;
    gap: 12px;
}

.lead-contacts-table__head {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    padding: 0 0 10px;
    color: #aab8cc;
    font-size: 0.72rem;
}

.lead-contact-row {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 12px 0;
    color: #f8fafc;
    font-size: 0.8rem;
}

.lead-contact-row>div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.lead-contact-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #60a5fa);
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 900;
}

.lead-contact-row strong,
.lead-contact-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-contact-row small {
    color: #93a4bd;
    font-size: 0.72rem;
}

.lead-impact-pill {
    width: fit-content;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 800;
}

.lead-impact-pill.is-high {
    background: rgba(16, 185, 129, 0.13);
    color: #86efac;
}

.lead-impact-pill.is-medium {
    background: rgba(245, 158, 11, 0.13);
    color: #fcd34d;
}

.lead-channel-icon,
.lead-mini-score {
    display: grid;
    place-items: center;
}

.lead-channel-icon svg {
    width: 17px;
    height: 17px;
    color: #60a5fa;
}

.lead-mini-score {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 50%;
    color: #86efac;
    font-size: 0.78rem;
    font-weight: 900;
}

.lead-add-contact,
.lead-widget__header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.55);
    color: #c8d4e6;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.lead-add-contact {
    width: 100%;
    margin-top: 12px;
    min-height: 38px;
}

.lead-add-contact svg,
.lead-widget__header button svg {
    width: 15px;
    height: 15px;
}

.lead-widget--history {
    grid-area: history;
}

.lead-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.lead-widget__header button {
    min-height: 30px;
    padding: 0 10px;
}

.lead-timeline {
    display: grid;
    gap: 0;
    margin-top: 16px;
}

.lead-timeline__item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 11px 0;
}

.lead-timeline__item .lead-history__icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.lead-timeline__item .lead-history__icon svg {
    width: 15px;
    height: 15px;
}

.lead-timeline__item strong,
.lead-timeline__item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-timeline__item strong {
    color: #f8fafc;
    font-size: 0.84rem;
}

.lead-timeline__item small {
    margin-top: 4px;
    color: #9aa9be;
    font-size: 0.72rem;
}

@media (max-width: 1280px) {
    .lead-detail-dashboard {
        grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.25fr);
        grid-template-areas:
            "profile profile"
            "score diagnosis"
            "context opportunity"
            "intelligence intelligence"
            "contacts history";
    }

    .lead-widget--profile {
        grid-template-columns: 1fr;
    }

    .lead-profile-metrics {
        border-left: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.16);
        padding-top: 16px;
    }

    .lead-intel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .lead-detail-dashboard {
        grid-template-columns: 1fr;
        grid-template-areas:
            "profile"
            "score"
            "diagnosis"
            "context"
            "intelligence"
            "opportunity"
            "contacts"
            "history";
    }

    .lead-diagnosis-grid,
    .lead-intel-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .lead-widget {
        padding: 15px;
    }

    .lead-widget--profile,
    .lead-company,
    .lead-profile-metrics,
    .lead-score-summary,
    .lead-diagnosis-grid,
    .lead-intel-grid,
    .lead-opportunity-metrics {
        grid-template-columns: 1fr;
    }

    .lead-company {
        align-items: flex-start;
        flex-direction: column;
    }

    .lead-profile-metrics div {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.14);
        padding: 14px 0;
    }

    .lead-profile-metrics div:last-child {
        border-bottom: 0;
    }

    .lead-detail-dashboard .lead-score-ring {
        justify-self: center;
    }

    .lead-company__logo {
        width: 64px;
        height: 64px;
        border-radius: 14px;
        font-size: 1.05rem;
    }

    .lead-company__title-row,
    .lead-company__meta,
    .lead-company__links {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .lead-company__title-row h2,
    .lead-context-list dd,
    .lead-intel-grid p,
    .lead-timeline__item strong,
    .lead-timeline__item small {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .lead-contacts-table {
        overflow-x: visible;
    }

    .lead-contacts-table__head {
        display: none;
    }

    .lead-contact-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 9px 12px;
        padding: 14px 0;
    }

    .lead-contact-row>div {
        grid-column: 1 / -1;
    }

    .lead-contact-row>span {
        display: block;
        min-width: 0;
    }

    .lead-contact-row .lead-impact-pill,
    .lead-contact-row .lead-channel-icon {
        width: auto;
        height: auto;
        min-height: 0;
        border-radius: 0;
        background: transparent;
        padding: 0;
        text-align: left;
    }

    .lead-contact-row .lead-impact-pill.is-high,
    .lead-contact-row .lead-impact-pill.is-medium {
        background: transparent;
    }

    .lead-contact-row .lead-mini-score {
        display: inline-grid;
        position: relative;
        width: 34px;
        height: 34px;
        margin-top: 18px;
        place-items: center;
        border-radius: 50%;
        background: rgba(16, 185, 129, 0.14);
        text-align: center;
    }

    .lead-contact-row .lead-impact-pill.is-high,
    .lead-contact-row .lead-mini-score {
        color: #86efac;
    }

    .lead-contact-row .lead-impact-pill.is-medium {
        color: #fde68a;
    }

    .lead-contact-row>span::before {
        display: block;
        margin-bottom: 3px;
        color: #64748b;
        font-size: 0.62rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .lead-contact-row>span:nth-child(2)::before {
        content: "Cargo";
    }

    .lead-contact-row>span:nth-child(3)::before {
        content: "Influencia";
    }

    .lead-contact-row>span:nth-child(4)::before {
        content: "Rol";
    }

    .lead-contact-row>span:nth-child(5)::before {
        content: "Canal";
    }

    .lead-contact-row>span:nth-child(6)::before {
        content: "Score";
    }

    .lead-contact-row .lead-mini-score::before {
        position: absolute;
        left: 0;
        top: -18px;
        width: max-content;
        margin-bottom: 0;
        text-align: left;
    }

    .lead-contact-row strong,
    .lead-contact-row small {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    padding: 24px;
}

button {
    font: inherit;
}

.public-lead-page {
    min-height: 100vh;
    margin: 0;
    padding: 50px 24px 28px;
    background: linear-gradient(115deg, #061a38 0%, #0b2f6f 100%);
    color: #ffffff;
}

.public-lead-shell {
    display: grid;
    grid-template-columns: minmax(320px, 600px) minmax(420px, 900px);
    gap: 44px;
    width: min(1500px, 100%);
    margin: 0 auto;
    align-items: center;
}

.public-lead-brand {
    display: grid;
    gap: 26px;
    padding: 58px 50px 50px;
    border-radius: 34px;
    background: rgba(2, 19, 47, 0.72);
}

.public-lead-brand__logo {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: baseline;
    color: #ffffff;
    font-size: 3rem;
    font-weight: 950;
    line-height: 1;
}

.public-lead-brand__logo strong {
    color: #2f8cff;
    letter-spacing: 0.04em;
}

.public-lead-brand h1 {
    max-width: 520px;
    margin: 28px 0 0;
    color: #ffffff;
    font-size: clamp(2.25rem, 4vw, 3.45rem);
    line-height: 0.96;
    text-transform: uppercase;
}

.public-lead-brand h1 span {
    color: #ffd21e;
}

.public-lead-brand>p {
    max-width: 520px;
    margin: 0;
    font-size: 1.38rem;
    line-height: 1.55;
}

.public-lead-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 12px;
}

.public-lead-benefits article {
    min-height: 132px;
    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.16);
}

.public-lead-benefits h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.public-lead-benefits p {
    margin: 0;
    line-height: 1.45;
}

.public-lead-card {
    padding: 54px;
    border-radius: 34px;
    background: #ffffff;
    color: #061a38;
}

.public-lead-card__heading {
    padding-bottom: 30px;
    border-bottom: 1px solid #dbeafe;
}

.public-lead-card__heading span {
    display: inline-flex;
    margin-bottom: 14px;
    color: #2563eb;
    font-weight: 900;
}

.public-lead-card__heading h2 {
    max-width: 760px;
    margin: 0;
    color: #061a38;
    font-size: clamp(2rem, 3vw, 2.65rem);
    line-height: 1.1;
}

.public-lead-card__heading h2 strong {
    color: #1263ff;
}

.public-lead-card__heading p {
    margin: 14px 0 0;
    color: #52647a;
    font-size: 1.08rem;
}

.public-lead-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 28px;
    padding-top: 34px;
}

.public-lead-form label {
    display: grid;
    gap: 12px;
    color: #061a38;
    font-size: 1rem;
    font-weight: 900;
}

.public-lead-form label strong {
    color: #ef4444;
}

.public-lead-form input {
    min-height: 70px;
    border: 1px solid #cbd8e8;
    border-radius: 18px;
    background: #ffffff;
    color: #061a38;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 18px 20px;
    outline: none;
}

.public-lead-form input:focus {
    border-color: #1263ff;
    box-shadow: 0 0 0 4px rgba(18, 99, 255, 0.12);
}

.public-lead-form__wide,
.public-lead-alert,
.public-lead-submit {
    grid-column: 1 / -1;
}

.public-lead-form em {
    color: #52647a;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 500;
}

.public-lead-alert {
    padding: 14px 16px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.public-lead-alert[data-type="success"] {
    background: #dcfce7;
    color: #166534;
}

.public-lead-submit {
    display: grid;
    gap: 5px;
    min-height: 92px;
    border: 0;
    border-radius: 18px;
    background: #1263e8;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(18, 99, 232, 0.26);
}

.public-lead-submit:disabled {
    cursor: wait;
    opacity: 0.78;
}

.public-lead-submit span {
    font-size: 1.25rem;
    font-weight: 900;
}

.public-lead-submit small {
    font-size: 0.92rem;
}

.public-lead-legal {
    margin: 30px 0 0;
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.55;
}

.public-lead-legal strong {
    color: #0657d8;
}

.public-lead-footer {
    width: min(1500px, 100%);
    margin: 34px auto 0;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
}

.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

.sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border-radius: var(--radius);
    padding: 24px 18px;
    min-height: calc(100vh - 48px);
    color: #ffffff;
}

.sidebar__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 32px;
    text-align: center;
}

.brand--logo {
    display: block;
    width: min(95px, 100%);
    line-height: 0;
}

.brand--logo img {
    display: block;
    width: 100%;
    height: auto;
}

.brand__subtitle {
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.sidebar__nav {
    display: grid;
    align-content: start;
    grid-auto-rows: max-content;
    gap: 4px;
    flex: 1;
}

.nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav__item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav__item--active {
    background: #3b82f6;
    color: #ffffff;
}

.nav__icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
}

.nav__icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.sidebar__footer {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.sidebar__footer strong {
    display: block;
    margin-top: 4px;
    color: #ffffff;
}

.sidebar__profile {
    margin-top: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
}

.sidebar__profile summary {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 10px;
    cursor: pointer;
    list-style: none;
}

.sidebar__profile summary::-webkit-details-marker {
    display: none;
}

.sidebar__profile summary>svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.sidebar__profile[open] summary>svg {
    transform: rotate(180deg);
}

.profile__avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #60a5fa);
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 900;
}

.profile__meta {
    min-width: 0;
}

.profile__meta strong,
.profile__meta small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile__meta strong {
    color: #f8fafc;
    font-size: 0.82rem;
}

.profile__meta small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 0.72rem;
}

.profile__settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 20px);
    min-height: 36px;
    margin: 0 10px 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.16);
    color: #dbeafe;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.profile__settings:hover {
    background: rgba(59, 130, 246, 0.24);
    color: #ffffff;
}

.profile__settings svg {
    width: 15px;
    height: 15px;
}

.company-profile-modal {
    width: min(820px, calc(100vw - 40px));
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #e5e7eb;
    padding: 0;
}

.company-profile-modal::backdrop {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}

.company-profile-modal__surface {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: #101524;
    box-shadow: 0 24px 80px rgba(2, 6, 23, 0.34);
}

.company-profile-modal__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 18px;
    align-items: start;
    padding: 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.company-profile-modal__identity {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.company-profile-modal__identity img {
    width: 88px;
    height: auto;
}

.company-profile-modal__identity span {
    display: block;
    margin-bottom: 8px;
    color: #93c5fd;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.company-profile-modal h2,
.company-profile-modal h3,
.company-profile-modal p,
.company-profile-modal dl {
    margin: 0;
}

.company-profile-modal h2 {
    color: #f8fafc;
    font-size: 1.45rem;
    line-height: 1.15;
}

.company-profile-modal p {
    margin-top: 8px;
    color: #aab8cc;
    font-size: 0.9rem;
    line-height: 1.5;
}

.company-profile-modal__close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    color: #cbd5e1;
    cursor: pointer;
}

.company-profile-modal__close svg {
    width: 17px;
    height: 17px;
}

.company-profile-modal__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 24px 24px;
}

.company-profile-modal__body section {
    min-height: 132px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.54);
    padding: 16px;
}

.company-profile-modal h3 {
    color: #f8fafc;
    font-size: 0.94rem;
    line-height: 1.25;
}

.company-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.company-profile-tags span {
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 6px 9px;
}

.company-profile-facts {
    display: grid;
    gap: 11px;
    margin-top: 0;
    padding-top: 14px;
}

.company-profile-facts div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding-bottom: 9px;
}

.company-profile-facts dt {
    color: #93a4bd;
    font-size: 0.78rem;
}

.company-profile-facts dd {
    margin: 0;
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: right;
}

.company-profile-modal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 24px;
}

.company-profile-modal__footer a,
.company-profile-modal__footer button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0 18px;
    text-decoration: none;
}

.company-profile-modal__footer a {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.62);
    color: #dbeafe;
}

.company-profile-modal__footer button {
    border: 0;
    background: #2563eb;
    color: #ffffff;
}

.main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topbar {
    position: sticky;
    top: var(--topbar-sticky-offset);
    z-index: 90;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.topbar__title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.topbar__title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.topbar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.topbar__action-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
}

.topbar__action-label {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar__action-group--general>span {
    display: none;
}

.topbar__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
    text-decoration: none;
    white-space: nowrap;
}

.topbar__button:hover {
    background: #1d4ed8;
}

.topbar__button--secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.topbar__button--secondary:hover {
    background: #eff6ff;
}

.topbar__button svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.4;
}

.follow-up-controls {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    max-width: 100%;
}

.follow-up-controls__limit {
    display: inline-grid;
    grid-template-columns: auto 74px;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 6px 8px 6px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
}

.follow-up-controls__limit input {
    width: 74px;
    min-height: 28px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    color: #0f172a;
    font: inherit;
    padding: 4px 7px;
}

.follow-up-status {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
}

.follow-up-status[hidden] {
    display: none;
}

.follow-up-status strong {
    display: block;
    margin-bottom: 4px;
    color: #f8fafc;
}

.follow-up-status p {
    margin: 0;
}

.follow-up-status ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.follow-up-status li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    font-size: 0.82rem;
}

.follow-up-status li span,
.follow-up-status li em {
    color: #93c5fd;
    font-style: normal;
}

.follow-up-status li strong {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .follow-up-controls,
    .follow-up-controls .topbar__button,
    .follow-up-controls__limit {
        width: 100%;
    }

    .follow-up-controls,
    .topbar__action-group {
        flex-wrap: wrap;
    }

    .topbar__action-label {
        width: 100%;
    }

    .follow-up-controls__limit {
        grid-template-columns: auto minmax(74px, 1fr);
    }

    .follow-up-controls__limit input {
        width: 100%;
    }

    .follow-up-status li {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .follow-up-status li strong {
        white-space: normal;
    }
}

.campaign-page {
    color: 1E293B;
}

.campaign-section {
    display: grid;
    gap: 18px;
}

.campaign-grid {
    display: grid;
    grid-template-columns: minmax(320px, 5fr) minmax(380px, 7fr);
    gap: 18px;
}

.campaign-panel {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: #0b1227;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    padding: 18px;
}

.campaign-panel__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.campaign-panel__title svg {
    width: 19px;
    height: 19px;
    color: #22d3ee;
}

.campaign-panel__title h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.15rem;
    line-height: 1.2;
}

.campaign-stack {
    display: grid;
    gap: 12px;
}

.campaign-page label {
    display: grid;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.82rem;
}

.campaign-page input,
.campaign-page select,
.campaign-page textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    background: #111827;
    color: #f8fafc;
    font: inherit;
    font-size: 0.9rem;
    outline: none;
    padding: 11px 12px;
}

.campaign-page textarea {
    min-height: 96px;
    line-height: 1.45;
    resize: vertical;
}

.campaign-page select[multiple] {
    min-height: 152px;
}

.campaign-page option {
    padding: 7px;
}

.campaign-page select[multiple] option:checked {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.35), rgba(34, 197, 94, 0.28));
    color: #ffffff;
}

.campaign-page input:focus,
.campaign-page select:focus,
.campaign-page textarea:focus {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.campaign-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.campaign-chips,
.campaign-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.campaign-chips {
    margin-bottom: 12px;
}

.campaign-chips span {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 6px 10px;
}

.campaign-prompt {
    min-height: 250px;
    font-size: 0.78rem;
    white-space: pre-wrap;
}

.campaign-form-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    margin-top: 14px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 14px;
    background: rgba(34, 211, 238, 0.05);
    padding: 14px;
}

.campaign-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.campaign-primary,
.campaign-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0 16px;
    text-decoration: none;
}

.campaign-primary {
    background: #22d3ee;
    color: #07111f;
}

.campaign-secondary {
    background: #16a34a;
    color: #ffffff;
}

.campaign-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
}

.campaign-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.campaign-table th {
    padding: 12px;
    background: #111827;
    color: #cbd5e1;
    text-align: left;
    white-space: nowrap;
}

.campaign-table td {
    padding: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
    vertical-align: middle;
}

.campaign-table strong,
.campaign-table small {
    display: block;
}

.campaign-table small {
    margin-top: 4px;
    color: #94a3b8;
}

.campaign-table .center {
    text-align: center;
}

.campaign-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 10px;
    white-space: nowrap;
}

.campaign-pill--active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.campaign-pill--paused {
    background: rgba(250, 204, 21, 0.2);
    color: #fde047;
}

.campaign-text-link {
    border: 0;
    background: transparent;
    color: #22d3ee;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-decoration: none;
}

@media (max-width: 980px) {

    .campaign-grid,
    .campaign-form-link,
    .campaign-two {
        grid-template-columns: 1fr;
    }

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

.lead-form-modal {
    width: min(560px, calc(100vw - 28px));
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
}

.lead-form-modal::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.lead-form-modal__surface {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.lead-form-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.lead-form-modal__header span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lead-form-modal__header h2 {
    margin: 6px 0;
    color: #0f172a;
    font-size: 1.25rem;
}

.lead-form-modal__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.lead-form-modal__close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
}

.lead-form-modal__close svg {
    width: 18px;
    height: 18px;
}

.lead-form-modal__body {
    display: grid;
    gap: 16px;
    padding: 22px 24px 24px;
}

.lead-form-modal__body label {
    display: grid;
    gap: 7px;
    color: #0f172a;
    font-weight: 800;
}

.lead-form-modal__body input,
.lead-form-modal__body select {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    padding: 9px 12px;
    outline: none;
}

.lead-form-modal__body input:focus,
.lead-form-modal__body select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.lead-form-modal__result {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 10px;
    background: #eff6ff;
}

.lead-form-modal__result span {
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 900;
}

.lead-form-modal__result a {
    color: #0f172a;
    overflow-wrap: anywhere;
}

.lead-form-modal__result button,
.lead-form-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.lead-form-modal__result button {
    width: fit-content;
    padding: 8px 12px;
}

.lead-form-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.lead-form-modal__button {
    padding: 9px 16px;
}

.lead-form-modal__button--muted {
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.filter-pill svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.filter-pill--action {
    background: var(--surface-alt);
}

.topbar__lead-filters {
    align-items: center;
}

.topbar__lead-filters[hidden] {
    display: none;
}

.topbar__lead-filters select,
.topbar__lead-filters input {
    min-height: 42px;
    min-width: 172px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: #1f2937;
    color: #e5e7eb;
    font: inherit;
    font-size: 0.9rem;
    padding: 9px 10px;
    outline: none;
}

.topbar__lead-filters select {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23E5E7EB' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.topbar__lead-filters input {
    min-width: 264px;
}

.topbar__lead-filters input::placeholder {
    color: #9ca3af;
}

.topbar__lead-filters select:focus,
.topbar__lead-filters input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.kpi-card {
    border-radius: 12px;
    padding: 16px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.kpi-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: 12px;
}

.kpi-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    justify-self: end;
    flex: 0 0 auto;
}

.kpi-card__icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.kpi-card__label {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.kpi-card h2 {
    margin: 10px 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-card span {
    font-size: 0.75rem;
    opacity: 0.8;
}

.kpi-card h2.kpi-card__main {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    min-height: 42px;
    font-size: 1.12rem;
    line-height: 1.2;
}

.kpi-card h2.kpi-card__main--trend {
    font-size: 1rem;
    line-height: 1.18;
}

.kpi-card__main svg {
    margin-top: 2px;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    stroke-width: 2.4;
}

.kpi-card span.kpi-card__number {
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0.85;
}

.kpi-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kpi-card__trend svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.4;
}

.kpi-card--blue {
    background: #0f172a;
}

.kpi-card--green {
    background: #064e3b;
}

.kpi-card--amber {
    background: #92400e;
}

.kpi-card--violet {
    background: #4c1d95;
}

.kpi-card--teal {
    background: #065f46;
}

.kpi-card--cyan {
    background: #1e3a8a;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    --summary-widget-height: 328px;
}

.grid-layout__main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 24px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel--campaign-performance {
    grid-column: 1 / -1;
    min-height: var(--summary-widget-height);
    display: flex;
    flex-direction: column;
    color: #e5e7eb;
    background:
        radial-gradient(circle at 18% 0%,
            rgba(59, 130, 246, 0.16),
            transparent 30%),
        linear-gradient(145deg, #0f172a 0%, #111827 52%, #0b1224 100%);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.panel--campaign-performance .panel__header {
    margin-bottom: 14px;
}

.panel--campaign-performance .panel__header h3 {
    color: #f8fafc;
    font-size: 1.08rem;
}

.campaign-performance {
    display: grid;
    gap: 0;
    min-width: 0;
}

.campaign-performance__header,
.campaign-performance__row {
    display: grid;
    grid-template-columns: minmax(170px, 1.55fr) repeat(5, minmax(136px, 1fr));
    align-items: center;
    column-gap: 20px;
}

.campaign-performance__header {
    padding: 0 0 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.26);
    color: #d1d5db;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
}

.campaign-performance__row {
    min-height: 43px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: #f8fafc;
    font-size: 0.86rem;
}

.campaign-performance__row:last-child {
    border-bottom: 0;
}

.campaign-performance__campaign {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 650;
}

.campaign-performance__campaign span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-dot {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.campaign-dot--blue {
    background: #3b82f6;
}

.campaign-dot--green {
    background: #22c55e;
}

.campaign-dot--amber {
    background: #facc15;
}

.campaign-dot--violet {
    background: #8b5cf6;
}

.campaign-dot--teal {
    background: #38bdf8;
}

.campaign-metric {
    display: grid;
    grid-template-columns: 38px minmax(58px, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.campaign-metric strong {
    color: #f8fafc;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.metric-bar {
    position: relative;
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.88);
}

.metric-bar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--value);
    border-radius: inherit;
}

.metric-bar--blue::before {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.metric-bar--green::before,
.metric-bar--success::before {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.metric-bar--amber::before {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}

.metric-bar--violet::before {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.panel--lead-evolution {
    height: var(--summary-widget-height);
    min-height: var(--summary-widget-height);
}

.panel--conversion-funnel,
.panel--gauge {
    height: var(--summary-widget-height);
    min-height: var(--summary-widget-height);
}

.panel--lead-evolution .chart--line {
    display: block;
    width: 100% !important;
    height: 230px !important;
}

.panel__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.panel__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.panel__header span {
    color: var(--muted);
    font-size: 0.8rem;
}

.chart {
    width: 100%;
    background: transparent;
    padding: 0;
    border: none;
}

canvas {
    max-width: 100%;
}

.chart--line::before {
    display: none;
}

.chart__legend {
    position: absolute;
    bottom: 16px;
    left: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.legend--blue::before {
    background: #3b82f6;
}

.legend--green::before {
    background: #10b981;
}

.legend--amber::before {
    background: #f59e0b;
}

.conversion-funnel {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) minmax(170px, 0.95fr);
    align-items: center;
    gap: 18px;
    min-height: 230px;
}

.conversion-funnel__shape {
    display: grid;
    gap: 0;
    width: 100%;
    max-width: 330px;
    margin: 0 auto;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.12));
}

.conversion-funnel__segment {
    height: 38px;
    border-top: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

.conversion-funnel__segment:first-child {
    border-top: 0;
}

.conversion-funnel__segment:last-child {
    border-bottom: 0;
}

.conversion-funnel__segment--blue {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    clip-path: polygon(0 0, 100% 0, 87% 100%, 13% 100%);
}

.conversion-funnel__segment--green {
    width: 76%;
    justify-self: center;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%);
}

.conversion-funnel__segment--amber {
    width: 58%;
    justify-self: center;
    background: linear-gradient(90deg, #f59e0b, #facc15);
    clip-path: polygon(0 0, 100% 0, 84% 100%, 16% 100%);
}

.conversion-funnel__segment--violet {
    width: 42%;
    justify-self: center;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
}

.conversion-funnel__segment--red {
    width: 24%;
    justify-self: center;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 0 0 4px 4px;
}

.conversion-funnel__legend {
    display: grid;
    gap: 14px;
}

.conversion-funnel__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 12px;
    font-size: 0.8rem;
    line-height: 1.15;
}

.conversion-funnel__row span {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.conversion-funnel__row strong {
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.conversion-funnel__row--blue span {
    color: #2563eb;
}

.conversion-funnel__row--green span {
    color: #16a34a;
}

.conversion-funnel__row--amber span {
    color: #f59e0b;
}

.conversion-funnel__row--violet span {
    color: #8b5cf6;
}

.conversion-funnel__row--red span {
    color: #ef4444;
}

.chart--mini-line {
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.22),
            transparent 35%);
}

.chart-frame {
    position: relative;
    width: 100%;
}

.chart-frame--matrix {
    height: 300px;
}

.priority-matrix {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: minmax(250px, 1fr) 34px;
    gap: 6px 8px;
    min-height: 318px;
    color: #0f172a;
}

.priority-matrix__plot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.priority-matrix__quadrant {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    min-height: 118px;
    padding: 14px 18px 13px;
    border-radius: 7px;
    color: #ffffff;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 14px rgba(15, 23, 42, 0.1);
}

.priority-matrix__quadrant::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.16),
            rgba(255, 255, 255, 0));
    pointer-events: none;
}

.priority-matrix__quadrant::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.95;
    background-repeat: no-repeat;
    background-image:
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px),
        radial-gradient(circle, #ffffff 0 2px, transparent 2.2px);
    background-position:
        48% 24%,
        58% 31%,
        66% 23%,
        72% 42%,
        80% 34%,
        54% 48%,
        62% 58%,
        74% 63%,
        84% 55%,
        50% 72%,
        68% 78%,
        86% 74%,
        38% 38%,
        44% 58%,
        56% 84%,
        76% 86%,
        90% 44%,
        64% 70%,
        82% 88%,
        70% 18%,
        92% 64%,
        58% 42%;
    pointer-events: none;
}

.priority-matrix__quadrant--blue {
    background: linear-gradient(135deg, #367deb, #195fc9);
}

.priority-matrix__quadrant--green {
    background: linear-gradient(135deg, #65bd5b, #2d963f);
}

.priority-matrix__quadrant--red {
    background: linear-gradient(135deg, #f5655d, #e3342f);
}

.priority-matrix__quadrant--amber {
    background: linear-gradient(135deg, #f6bf22, #ee9905);
}

.priority-matrix__quadrant h4,
.priority-matrix__quadrant p,
.priority-matrix__action {
    position: relative;
    z-index: 1;
}

.priority-matrix__quadrant h4 {
    margin: 0;
    font-size: clamp(0.7rem, 1.4vw, 0.9rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.priority-matrix__quadrant--green h4,
.priority-matrix__quadrant--amber h4 {
    text-align: right;
}

.priority-matrix__quadrant p {
    display: grid;
    gap: 1px;
    width: max-content;
    max-width: 72px;
    margin: 10px 0 0;
    padding: 4px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.12);
    font-size: 0.66rem;
    line-height: 1.05;
    font-weight: 700;
}

.priority-matrix__quadrant--green p,
.priority-matrix__quadrant--amber p {
    margin-left: auto;
    text-align: right;
}

.priority-matrix__quadrant p span {
    opacity: 0.92;
}

.priority-matrix__action {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: none;
}

.priority-matrix__quadrant--green .priority-matrix__action,
.priority-matrix__quadrant--amber .priority-matrix__action {
    justify-content: flex-end;
    text-align: right;
}

.priority-matrix__action svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.priority-matrix__axis {
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
}

.priority-matrix__axis strong {
    color: #111827;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
}

.priority-matrix__axis--y {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    justify-items: center;
    align-items: center;
    padding-top: 1px;
}

.priority-matrix__axis--y strong {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin: 7px 0;
}

.priority-matrix__axis--x {
    grid-column: 2;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 7px;
}

.priority-matrix__axis-line {
    position: relative;
    display: block;
}

.priority-matrix__axis--y .priority-matrix__axis-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(#79cda1, #cbd5e1 52%, #d7a492);
}

.priority-matrix__axis--x .priority-matrix__axis-line {
    height: 2px;
    background: #cbd5e1;
}

.priority-matrix__axis--y .priority-matrix__axis-line::before,
.priority-matrix__axis--y .priority-matrix__axis-line::after,
.priority-matrix__axis--x .priority-matrix__axis-line::before,
.priority-matrix__axis--x .priority-matrix__axis-line::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-style: solid;
}

.priority-matrix__axis--y .priority-matrix__axis-line::before {
    top: -1px;
    left: 50%;
    border-width: 2px 2px 0 0;
    border-color: #65b987;
    transform: translateX(-50%) rotate(-45deg);
}

.priority-matrix__axis--y .priority-matrix__axis-line::after {
    bottom: -1px;
    left: 50%;
    border-width: 0 0 2px 2px;
    border-color: #c89483;
    transform: translateX(-50%) rotate(-45deg);
}

.priority-matrix__axis--x .priority-matrix__axis-line::before {
    left: 0;
    top: 50%;
    border-width: 0 0 2px 2px;
    border-color: #cbd5e1;
    transform: translateY(-50%) rotate(45deg);
}

.priority-matrix__axis--x .priority-matrix__axis-line::after {
    right: 0;
    top: 50%;
    border-width: 2px 2px 0 0;
    border-color: #cbd5e1;
    transform: translateY(-50%) rotate(45deg);
}

.chart-frame--sector {
    height: 300px;
}

.chart-frame--donut {
    height: 190px;
}

.chart-frame--pipeline {
    height: 260px;
}

.chart-frame--monthly-score {
    height: 230px;
}

.chart--matrix {
    background: transparent;
    border: none;
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart--donut {
    background: transparent;
    border: none;
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart--bar-vertical {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart--pipeline {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart--monthly-score {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.panel--small {
    min-height: 320px;
}

.panel--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    grid-column: span 2;
}

.mini-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px;
    min-width: 0;
}

.mini-card h4 {
    margin: 0 0 18px;
    font-size: 0.98rem;
    line-height: 1.25;
}

.donut-widget {
    display: grid;
    grid-template-columns: minmax(130px, 0.9fr) minmax(150px, 1fr);
    align-items: center;
    gap: 18px;
}

.donut-legend {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.donut-legend__item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    color: var(--text);
}

.donut-legend__item strong,
.donut-legend__item span {
    display: block;
    line-height: 1.3;
}

.donut-legend__item strong {
    font-size: 0.86rem;
    font-weight: 700;
}

.donut-legend__item span {
    margin-top: 4px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
}

.donut-legend__swatch {
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.donut-legend__swatch--blue {
    background: var(--accent);
}

.donut-legend__swatch--green {
    background: var(--success);
}

.donut-legend__swatch--amber {
    background: var(--warning);
}

.donut-legend__swatch--red {
    background: var(--danger);
}

.grid-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel--gauge {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 8px;
}

.gauge {
    position: relative;
    width: 100%;
    max-width: 292px;
    height: 178px;
    margin: auto auto 0;
}

.gauge__arc {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 146px;
    overflow: hidden;
}

.gauge__arc::before,
.gauge__arc::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
}

.gauge__arc::before {
    background: conic-gradient(from 270deg,
            #37b24d 0deg 134deg,
            #e5e7eb 134deg 180deg,
            transparent 180deg 360deg);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.gauge__arc::after {
    inset: 40px 40px auto;
    width: auto;
    background: var(--surface);
}

.gauge__value {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 94px;
    transform: translate(-50%, -50%);
    color: #0f172a;
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.gauge__label {
    position: absolute;
    z-index: 1;
    bottom: 4px;
    left: 50%;
    width: max-content;
    max-width: 180px;
    transform: translateX(-50%);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.gauge__scale {
    position: absolute;
    z-index: 1;
    left: 18px;
    right: 18px;
    bottom: 4px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    pointer-events: none;
}

.panel--insights {
    display: grid;
    gap: 12px;
}

.insight-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.insight-card__icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    margin-top: 2px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.68);
}

.insight-card__icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.4;
}

.insight-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.76rem;
    line-height: 1.35;
    font-weight: 800;
}

.insight-card p {
    margin: 0;
    color: var(--text);
    font-size: 0.74rem;
    line-height: 1.35;
    font-weight: 600;
}

.insight-card--green {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.insight-card--green .insight-card__icon svg {
    color: #16a34a;
}

.insight-card--amber {
    background: #fffbeb;
    border-color: #fef3c7;
}

.insight-card--amber .insight-card__icon svg {
    color: #d97706;
}

.insight-card--blue {
    background: #eff6ff;
    border-color: #dbeafe;
}

.insight-card--blue .insight-card__icon svg {
    color: #2563eb;
}

.insight-card--violet {
    background: #f5f3ff;
    border-color: #ede9fe;
}

.insight-card--violet .insight-card__icon svg {
    color: #7c3aed;
}

.bottom-section {
    display: grid;
    gap: 24px;
}

.panel--table {
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    table-layout: fixed;
}

th,
td {
    text-align: left;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.2;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    font-size: 0.64rem;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.col-priority {
    width: 2.5%;
}

.col-company {
    width: 14%;
}

.col-contact {
    width: 11%;
}

.col-sector {
    width: 9%;
}

.col-score {
    width: 8%;
}

.col-type {
    width: 14%;
}

.col-next {
    width: 19%;
}

.col-status {
    width: 8%;
}

.col-owner {
    width: 8%;
}

.col-date {
    width: 6.5%;
}

th:nth-child(5),
td:nth-child(5),
th:nth-child(8),
td:nth-child(8),
th:nth-child(10),
td:nth-child(10) {
    white-space: nowrap;
}

.priority-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    vertical-align: middle;
}

.priority-dot--green {
    background: #22c55e;
}

.priority-dot--orange {
    background: #f97316;
}

.priority-dot--red {
    background: #ef4444;
}

.priority-dot--pink {
    background: #fca5a5;
}

.table-date {
    color: var(--text);
    font-size: 0.78rem;
    white-space: nowrap;
}

tbody tr:hover {
    background: var(--surface-alt);
}

.panel--lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.list-group {
    min-width: 0;
    padding: 2px 10px 4px;
}

.list-group+.list-group {
    border-left: 1px solid var(--border);
    padding-left: 34px;
}

.list-group h3 {
    margin: 0 0 24px;
    font-size: 1.05rem;
    line-height: 1.25;
}

.list-item {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.18fr) minmax(76px,
            auto);
    align-items: center;
    gap: 12px;
    min-height: 32px;
    margin-bottom: 15px;
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item span {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.25;
}

.list-item strong {
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.progress {
    position: relative;
    height: 20px;
    border-left: 1px solid var(--border);
    background: transparent;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.progress--blue span {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.progress--purple span {
    background: linear-gradient(90deg, #7e3dbd, #a855f7);
}

.bar-axis {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.18fr) minmax(76px,
            auto);
    gap: 12px;
    padding-top: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.bar-axis__scale {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: repeat(6, minmax(34px, 1fr));
}

.bar-axis__scale span {
    justify-self: center;
    transform: none;
    white-space: nowrap;
}

.bar-axis__scale span:first-child {
    justify-self: start;
}

.bar-axis__scale span:last-child {
    justify-self: end;
}

.relation-score-row {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 24px;
    align-items: stretch;
}

.panel--solution-map {
    min-width: 0;
}

.panel--monthly-score {
    min-width: 0;
}

.solution-map {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 36px minmax(220px, 1.15fr);
    align-items: center;
    column-gap: 18px;
    row-gap: 14px;
    color: var(--text);
    font-size: 0.84rem;
}

.solution-map>div,
.solution-map strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.solution-map__head {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 800;
}

.solution-map__arrow {
    color: #0f766e;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.solution-map strong {
    font-weight: 700;
}

.panel--status {
    display: grid;
    gap: 12px;
}

.signals-widget {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 14px;
}

.signals-widget__column {
    min-width: 0;
}

.signals-widget__column--positive {
    padding-right: 18px;
    border-right: 1px solid var(--border);
}

.signals-widget__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
}

.signals-widget__column--positive .signals-widget__header {
    background: var(--success);
}

.signals-widget__column--negative .signals-widget__header {
    background: var(--danger);
}

.signals-list {
    display: grid;
    gap: 7px;
}

.signals-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.25;
}

.signals-list__row span {
    overflow-wrap: anywhere;
}

.signals-list__row strong {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.signals-widget__summary {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding-top: 8px;
    text-align: center;
}

.signals-widget__summary--positive {
    border-right: 1px solid var(--border);
}

.signals-widget__summary strong {
    font-size: 2rem;
    line-height: 1;
}

.signals-widget__summary span {
    color: var(--text);
    font-size: 0.88rem;
}

.signals-widget__summary--positive strong {
    color: var(--success);
}

.signals-widget__summary--negative strong {
    color: var(--danger);
}

.panel--pipeline {
    display: grid;
    gap: 10px;
}

.pipeline-total {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 1340px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .panel--campaign-performance {
        overflow-x: auto;
    }

    .campaign-performance {
        min-width: 940px;
    }

    .panel--wide {
        grid-column: auto;
    }

    .panel--lead-evolution,
    .panel--conversion-funnel {
        grid-column: 1 / -1;
    }
}

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

    .grid-layout {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .grid-layout__main {
        display: contents;
        grid-template-columns: 1fr !important;
        grid-auto-columns: 1fr;
    }

    .grid-layout__aside {
        display: contents;
    }

    .grid-layout .panel {
        order: 20;
    }

    .panel--campaign-performance {
        order: 1;
        overflow-x: visible;
    }

    .campaign-performance {
        min-width: 0;
        gap: 12px;
    }

    .campaign-performance__header {
        display: none;
    }

    .campaign-performance__row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: 0;
        padding: 13px 0 14px;
        border-bottom-color: rgba(148, 163, 184, 0.18);
    }

    .campaign-performance__header+.campaign-performance__row {
        padding-top: 0;
    }

    .campaign-performance__campaign {
        font-size: 0.88rem;
    }

    .campaign-performance__campaign span:last-child {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .campaign-metric {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 12px;
        padding-left: 23px;
    }

    .campaign-metric::before {
        color: #cbd5e1;
        font-size: 0.68rem;
        font-weight: 800;
        line-height: 1.15;
        text-transform: uppercase;
    }

    .campaign-metric:nth-child(2)::before {
        content: "Leads generados";
    }

    .campaign-metric:nth-child(3)::before {
        content: "Leads calificados";
    }

    .campaign-metric:nth-child(4)::before {
        content: "Alta intencion";
    }

    .campaign-metric:nth-child(5)::before {
        content: "Oportunidades reales";
    }

    .campaign-metric:nth-child(6)::before {
        content: "Tasa conversion";
    }

    .campaign-metric strong {
        justify-self: end;
        font-size: 0.78rem;
    }

    .campaign-metric .metric-bar {
        grid-column: 1 / -1;
        height: 7px;
    }

    .panel--lead-evolution {
        order: 2;
    }

    .panel--conversion-funnel {
        order: 3;
    }

    .panel--gauge {
        order: 4;
    }

    .panel--priority-matrix {
        order: 5;
    }

    .panel--sector-analysis {
        order: 6;
    }

    .topbar {
        flex-direction: column;
    }

    /* Ajuste de widgets a una sola columna para evitar compresion */
    .panel--row {
        grid-template-columns: 1fr;
    }

    .conversion-funnel {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .conversion-funnel__shape {
        max-width: 300px;
    }

    .conversion-funnel__segment {
        height: 40px;
    }

    .conversion-funnel__legend {
        gap: 12px;
    }

    .panel--lists {
        grid-template-columns: 1fr;
    }

    .relation-score-row {
        grid-template-columns: 1fr;
    }

    .solution-map {
        grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
        column-gap: 10px;
        row-gap: 12px;
        font-size: 0.8rem;
    }

    .solution-map__head {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .solution-map__arrow {
        font-size: 0.95rem;
    }

    .list-group+.list-group {
        border-left: 0;
        border-top: 1px solid var(--border);
        padding-left: 10px;
        padding-top: 24px;
    }

    .signals-widget {
        grid-template-columns: 1fr;
    }

    .signals-widget__column--positive,
    .signals-widget__summary--positive {
        padding-right: 0;
        border-right: 0;
    }
}

@media (max-width: 680px) {
    body {
        padding: 12px;
    }

    .dashboard,
    .main {
        gap: 16px;
    }

    .sidebar {
        min-height: 0;
        padding: 14px;
        border-radius: 12px;
    }

    .sidebar__brand {
        flex-direction: row;
        justify-content: center;
        margin-bottom: 14px;
    }

    .brand--logo {
        width: 72px;
    }

    .brand__subtitle,
    .sidebar__footer {
        display: none;
    }

    .sidebar__nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        flex: 0 0 auto;
    }

    .nav__item {
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        padding: 9px 10px;
        border-radius: 10px;
        font-size: 0.78rem;
        text-align: center;
    }

    .nav__icon {
        width: 20px;
        height: 20px;
    }

    .sidebar__profile {
        margin-top: 10px;
    }

    .topbar {
        align-items: stretch;
        gap: 14px;
        padding: 16px;
        border-radius: 12px;
    }

    .topbar__title h1 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .topbar__title p {
        font-size: 0.82rem;
    }

    .topbar__filters {
        width: 100%;
    }

    .topbar__actions,
    .topbar__button {
        width: 100%;
    }

    .topbar__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .lead-form-modal__header,
    .lead-form-modal__body {
        padding: 18px;
    }

    .lead-form-modal__footer {
        flex-direction: column-reverse;
    }

    .lead-form-modal__button {
        width: 100%;
    }

    .topbar__lead-filters,
    .topbar__lead-filters select,
    .topbar__lead-filters input {
        width: 100%;
        min-width: 0;
    }

    .kpis {
        grid-template-columns: 1fr;
    }

    .grid-layout__main {
        grid-template-columns: 1fr !important;
        grid-auto-columns: 1fr;
    }

    .panel--lead-evolution {
        height: auto;
        min-height: 0;
    }

    .panel--campaign-performance {
        min-height: 0;
        padding: 18px;
        overflow-x: visible;
    }

    .campaign-performance {
        min-width: 0;
        gap: 12px;
    }

    .campaign-performance__header {
        display: none;
    }

    .campaign-performance__row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: 0;
        padding: 13px 0 14px;
        border-bottom-color: rgba(148, 163, 184, 0.18);
    }

    .campaign-performance__header+.campaign-performance__row {
        padding-top: 0;
    }

    .campaign-performance__campaign {
        font-size: 0.88rem;
    }

    .campaign-performance__campaign span:last-child {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .campaign-metric {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 12px;
        padding-left: 23px;
    }

    .campaign-metric::before {
        color: #cbd5e1;
        font-size: 0.68rem;
        font-weight: 800;
        line-height: 1.15;
        text-transform: uppercase;
    }

    .campaign-metric:nth-child(2)::before {
        content: "Leads generados";
    }

    .campaign-metric:nth-child(3)::before {
        content: "Leads calificados";
    }

    .campaign-metric:nth-child(4)::before {
        content: "Alta intencion";
    }

    .campaign-metric:nth-child(5)::before {
        content: "Oportunidades reales";
    }

    .campaign-metric:nth-child(6)::before {
        content: "Tasa conversion";
    }

    .campaign-metric strong {
        justify-self: end;
        font-size: 0.78rem;
    }

    .campaign-metric .metric-bar {
        grid-column: 1 / -1;
        height: 7px;
    }

    .panel--lead-evolution .chart--line {
        height: 250px !important;
    }

    .panel--solution-map {
        padding: 18px;
    }

    .solution-map {
        grid-template-columns: 1fr;
        row-gap: 7px;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .solution-map__head {
        display: none;
    }

    .solution-map__arrow {
        justify-self: center;
        transform: rotate(90deg);
        font-size: 0.9rem;
        line-height: 1;
    }

    .solution-map strong {
        padding-bottom: 13px;
        border-bottom: 1px solid var(--border);
    }

    .solution-map strong:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .panel--conversion-funnel,
    .panel--gauge {
        height: auto;
        min-height: 0;
    }

    .priority-matrix {
        grid-template-columns: 28px minmax(0, 1fr);
        grid-template-rows: minmax(230px, 1fr) 32px;
        gap: 6px;
        min-height: 286px;
    }

    .priority-matrix__plot {
        gap: 6px;
    }

    .priority-matrix__quadrant {
        min-height: 110px;
        padding: 11px 10px 10px;
    }

    .priority-matrix__quadrant h4 {
        font-size: 0.68rem;
    }

    .priority-matrix__quadrant p,
    .priority-matrix__action,
    .priority-matrix__axis,
    .priority-matrix__axis strong {
        font-size: 0.62rem;
    }

    .priority-matrix__action svg {
        width: 18px;
        height: 18px;
    }

    .panel--table {
        padding: 16px;
    }

    .panel--table .panel__header {
        margin-bottom: 14px;
    }

    .panel--table colgroup,
    .panel--table thead {
        display: none;
    }

    .panel--table table,
    .panel--table tbody,
    .panel--table tr,
    .panel--table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .panel--table tbody {
        display: grid;
        gap: 12px;
    }

    .panel--table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface-alt);
    }

    .panel--table td {
        padding: 0;
        border-bottom: 0;
        font-size: 0.88rem;
        line-height: 1.25;
        overflow-wrap: break-word;
        word-break: normal;
        white-space: normal;
    }

    .panel--table td::before {
        content: "";
        display: block;
        margin-bottom: 3px;
        color: var(--muted);
        font-size: 0.66rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .panel--table td:nth-child(1) {
        display: none;
    }

    .panel--table td:nth-child(2) {
        grid-column: 1 / -1;
        font-size: 1rem;
        font-weight: 700;
    }

    .panel--table td:nth-child(2)::before {
        content: "Empresa";
    }

    .panel--table td:nth-child(3)::before {
        content: "Contacto";
    }

    .panel--table td:nth-child(4)::before {
        content: "Sector";
    }

    .panel--table td:nth-child(5)::before {
        content: "Score total";
    }

    .panel--table td:nth-child(6)::before {
        content: "Tipo oportunidad";
    }

    .panel--table td:nth-child(7)::before {
        content: "Proximo paso recomendado";
    }

    .panel--table td:nth-child(8)::before {
        content: "Estado";
    }

    .panel--table td:nth-child(9)::before {
        content: "Responsable";
    }

    .panel--table td:nth-child(10)::before {
        content: "Fecha proximo paso";
    }

    .panel--table td:nth-child(7),
    .panel--table td:nth-child(9),
    .panel--table td:nth-child(10) {
        grid-column: 1 / -1;
    }

    .panel--lists {
        padding: 18px;
        overflow: hidden;
    }

    .list-group {
        padding: 0;
    }

    .list-group+.list-group {
        padding-left: 0;
    }

    .list-group h3 {
        margin-bottom: 18px;
        font-size: 1rem;
    }

    .list-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 12px;
        align-items: start;
        min-height: 0;
        margin-bottom: 16px;
    }

    .list-item span {
        min-width: 0;
        font-size: 0.78rem;
        line-height: 1.22;
    }

    .list-item>span:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .list-item strong {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        font-size: 0.74rem;
        line-height: 1.2;
        text-align: right;
    }

    .list-item .progress {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 16px;
    }

    .bar-axis {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 0;
        font-size: 0.68rem;
    }

    .bar-axis__scale {
        grid-column: 1;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* === Responsive charts and lead screens fix - 2026-05-05 === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.dashboard,
.main,
.content,
.grid-layout,
.grid-layout__main,
.grid-layout__aside,
.panel,
.lead-detail-dashboard,
.lead-widget {
    min-width: 0;
}

.main {
    overflow-x: clip;
}

.panel {
    overflow: hidden;
}

.panel__header h3,
.panel__header span {
    overflow-wrap: anywhere;
}

.grid-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    align-items: start;
}

.grid-layout__main {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.panel--row,
.panel--campaign-performance,
.panel--status,
.panel--pipeline,
.panel--table,
.panel--lists {
    grid-column: 1 / -1;
}

.chart-frame {
    min-width: 0;
    overflow: visible;
}

.chart-frame canvas,
.chart,
canvas {
    display: block;
    max-width: 100% !important;
}

.panel--lead-evolution {
    height: auto;
    min-height: 360px;
}

.panel--lead-evolution .chart--line {
    height: 300px !important;
}

.chart-frame--sector {
    min-height: 320px;
    height: auto;
}

.chart-frame--donut {
    height: 210px;
    min-height: 0;
    overflow: hidden;
}

.chart-frame--pipeline {
    height: 300px;
    min-height: 0;
    overflow: hidden;
}

.chart-frame--monthly-score {
    height: 270px;
    min-height: 0;
    overflow: hidden;
}

.chart--bar-vertical,
.chart--donut,
.chart--pipeline,
.chart--monthly-score {
    min-height: inherit;
}

.chart-frame--sector {
    height: clamp(320px, 40vh, 420px);
    min-height: 0;
    max-height: 420px;
    overflow-x: hidden;
    overflow-y: auto;
}

.chart-frame--sector .chart-frame__scroll {
    height: var(--chart-content-height, 100%);
    min-height: 100%;
}

.chart-frame--sector .chart--bar-vertical {
    height: 100% !important;
    min-height: 0;
}

.chart-frame--donut .chart--donut {
    height: 100% !important;
    min-height: 0;
}

.chart-frame--monthly-score .chart--monthly-score {
    height: 100% !important;
    min-height: 0;
}

.chart-frame--pipeline .chart--pipeline {
    height: 100% !important;
    min-height: 0;
}

.donut-widget {
    grid-template-columns: minmax(120px, 0.82fr) minmax(160px, 1fr);
    align-items: center;
}

.donut-legend {
    gap: 10px;
}

.donut-legend__item {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 9px;
}

.donut-legend__item strong,
.donut-legend__item span {
    overflow-wrap: anywhere;
}

.campaign-performance {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
}

.campaign-performance__header,
.campaign-performance__row {
    min-width: 820px;
    grid-template-columns: minmax(190px, 1.45fr) repeat(5, minmax(110px, 1fr));
    column-gap: 14px;
}

.campaign-performance__campaign strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-metric {
    grid-template-columns: minmax(36px, auto) minmax(52px, 1fr);
}

.metric-bar {
    width: 100% !important;
}

.signals-widget {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.signals-widget__column,
.signals-widget__summary {
    min-width: 0;
}

.signals-list__row,
.signals-widget__header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.signals-list__row span,
.signals-widget__header span:first-child {
    overflow-wrap: anywhere;
}

.signals-list__row strong {
    white-space: nowrap;
}

.panel--lists {
    overflow: hidden;
}

.list-item {
    grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr) auto;
    gap: 10px;
}

.list-item span,
.list-item strong {
    overflow-wrap: anywhere;
}

.progress {
    min-width: 80px;
}

.bar-axis__scale span {
    white-space: nowrap;
}

.leads-prioritization-section {
    width: 100%;
    overflow: hidden;
}

.leads-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leads-prioritization-section table {
    min-width: 1120px;
}

.leads-prioritization-section td,
.leads-prioritization-section th {
    white-space: normal;
    overflow-wrap: anywhere;
}

.leads-prioritization-section td:first-child .text-surface-500 {
    white-space: normal;
}

#leads-pagination {
    gap: 12px;
    flex-wrap: wrap;
}

.lead-detail-dashboard {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(0, 0.95fr);
}

.lead-widget {
    overflow: hidden;
}

.lead-widget h3,
.lead-widget h4,
.lead-widget p,
.lead-widget span,
.lead-widget strong,
.lead-widget dd,
.lead-widget dt,
.lead-widget small {
    overflow-wrap: anywhere;
}

.lead-widget--profile {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
}

.lead-company,
.lead-company__body,
.lead-company__links,
.lead-company__meta {
    min-width: 0;
}

.lead-company__links span,
.lead-context-link {
    word-break: break-word;
}

.lead-profile-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-diagnosis-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-intel-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lead-opportunity-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-contacts-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lead-contacts-table__head,
.lead-contact-row {
    min-width: 760px;
}

@media (max-width: 1340px) {
    .public-lead-shell {
        grid-template-columns: 1fr;
        max-width: 900px;
    }

    .public-lead-brand {
        padding: 42px;
    }

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

    .grid-layout__aside {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel--gauge,
    .panel--conversion-funnel {
        min-height: 320px;
        height: auto;
    }
}

@media (max-width: 980px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .main {
        width: 100%;
    }

    .topbar {
        gap: 14px;
        flex-wrap: wrap;
    }

    .topbar__filters,
    .topbar__lead-filters {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-layout__aside,
    .panel--row,
    .signals-widget {
        grid-template-columns: 1fr;
    }

    .conversion-funnel,
    .donut-widget {
        grid-template-columns: 1fr;
    }

    .chart-frame--donut {
        height: 230px;
        min-height: 0;
    }

    .lead-detail-dashboard,
    .lead-widget--profile,
    .lead-diagnosis-grid,
    .lead-intel-grid,
    .lead-opportunity-metrics {
        grid-template-columns: 1fr;
    }

    .lead-profile-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .public-lead-page {
        padding: 18px 14px 22px;
    }

    .public-lead-shell {
        gap: 18px;
    }

    .public-lead-brand,
    .public-lead-card {
        border-radius: 20px;
        padding: 24px;
    }

    .public-lead-brand__logo {
        gap: 10px;
        font-size: 2.1rem;
    }

    .public-lead-brand h1 {
        margin-top: 8px;
        font-size: 2rem;
        line-height: 1;
    }

    .public-lead-brand>p {
        font-size: 1rem;
    }

    .public-lead-benefits,
    .public-lead-form {
        grid-template-columns: 1fr;
    }

    .public-lead-benefits article {
        min-height: 0;
    }

    .public-lead-card__heading h2 {
        font-size: 1.9rem;
    }

    .public-lead-form input {
        min-height: 56px;
        border-radius: 14px;
    }

    body {
        overflow-x: clip;
    }

    .content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .panel {
        padding: 16px;
        border-radius: 14px;
    }

    .panel__header {
        margin-bottom: 14px;
    }

    .topbar__filters,
    .topbar__lead-filters {
        grid-template-columns: 1fr;
    }

    .panel--lead-evolution .chart--line {
        height: 340px !important;
    }

    .chart-frame--sector {
        height: 380px;
        min-height: 0;
        max-height: 380px;
    }

    .chart-frame--pipeline {
        height: 360px;
        min-height: 0;
    }

    .chart-frame--monthly-score {
        height: 320px;
        min-height: 0;
    }

    .chart-frame--donut {
        height: 250px;
        min-height: 0;
    }

    .campaign-performance__header {
        display: none;
    }

    .campaign-performance {
        overflow: visible;
    }

    .campaign-performance__row {
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 14px 0;
        align-items: stretch;
    }

    .campaign-performance__campaign {
        grid-column: 1 / -1;
    }

    .campaign-performance__campaign strong {
        white-space: normal;
    }

    .campaign-metric {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 9px;
        border: 1px solid rgba(148, 163, 184, 0.14);
        border-radius: 10px;
        background: rgba(15, 23, 42, 0.55);
    }

    .campaign-metric strong {
        font-size: 0.8rem;
    }

    .signals-list__row,
    .signals-widget__header {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .signals-list__row strong {
        white-space: normal;
    }

    .list-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .list-item .progress {
        grid-column: 1 / -1;
    }

    .lead-profile-metrics {
        grid-template-columns: 1fr;
    }

    .lead-company__title-row,
    .lead-company__meta,
    .lead-company__links {
        align-items: flex-start;
        flex-direction: column;
    }

    .lead-detail__back {
        color: #0f172a;
    }

    .leads-prioritization-section {
        padding: 14px;
        border-radius: 14px;
    }

    .leads-prioritization-section table {
        min-width: 0;
    }

    .leads-table-filters.topbar__lead-filters {
        grid-template-columns: 1fr;
        min-width: 0;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid rgba(148, 163, 184, 0.18);
        border-radius: 12px;
        background: #0f172a;
    }

    #leads-pagination {
        align-items: flex-start;
        justify-content: flex-start;
    }
}

@media (min-width: 681px) and (max-width: 980px) {
    .leads-table-filters.topbar__lead-filters {
        grid-template-columns: minmax(180px, 220px) minmax(160px, 190px) minmax(240px, 1fr);
        min-width: 1120px;
        width: max-content;
    }
}

/* =============================================
   Ajuste responsive: barra lateral -> barra superior
   a partir de 1340px de ancho
   ============================================= */
@media (max-width: 1340px) {
    :root {
        --topbar-sticky-offset: 62px;
    }

    .dashboard {
        display: flex;
        flex-direction: column;
        /* apila la barra y el contenido */
        gap: 0;
    }

    .sidebar {
        top: 0;
        z-index: 100;
        align-self: stretch;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        min-height: auto;
        padding: 10px 20px;
        border-radius: 0;
        /* elimina el borde redondeado para que se una al contenido */
        background: #0f172a;
        /* mantiene el fondo oscuro */
        color: #ffffff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    }

    .sidebar__brand {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 0;
        align-items: center;
    }

    .brand--logo {
        width: 60px;
        /* logo mas pequeno */
    }

    .brand__subtitle {
        font-size: 0.7rem;
        letter-spacing: 0.08em;
    }

    .sidebar__nav {
        display: flex;
        flex-direction: row;
        gap: 8px;
        margin-left: auto;
        /* empuja la navegacion a la derecha (opcional) */
    }

    .nav__item {
        padding: 8px 14px;
        font-size: 0.82rem;
        border-radius: 8px;
        white-space: nowrap;
    }

    /* Oculta elementos que no caben en una barra tan compacta */
    .sidebar__footer,
    .sidebar__profile {
        display: none;
    }
}

/* =============================================
   Evita que textos largos en KPI cards se corten
   ============================================= */
.kpi-card h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    line-height: 1.2;
}

/* Opcional: reduce el tamano de fuente en pantallas muy pequenas */
@media (max-width: 980px) {
    :root {
        --topbar-sticky-offset: 62px;
    }

    .kpi-card h2 {
        font-size: 1.45rem;
    }
}

@media (max-width: 680px) {
    :root {
        --topbar-sticky-offset: 124px;
    }

    .sidebar__nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        margin-left: 0;
    }

    .nav__item {
        white-space: normal;
    }
}

/* =============================================
   Responsive fix: key executive widgets
   ============================================= */
@media (max-width: 980px) {

    .grid-layout,
    .grid-layout__main,
    .grid-layout__aside,
    .panel--lead-evolution,
    .panel--sector-analysis,
    .panel--row,
    .mini-card,
    .panel--campaign-performance,
    .panel--conversion-funnel,
    .panel--priority-matrix {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .panel--lead-evolution,
    .panel--sector-analysis,
    .panel--row,
    .panel--campaign-performance,
    .panel--conversion-funnel,
    .panel--priority-matrix {
        justify-self: stretch;
        align-self: stretch;
    }

    .panel--lead-evolution {
        overflow: hidden;
    }

    .panel--lead-evolution .chart--line {
        width: 100% !important;
        max-width: 100% !important;
        height: clamp(300px, 42vw, 360px) !important;
    }

    .panel--sector-analysis {
        overflow: hidden;
    }

    .chart-frame--sector {
        width: 100%;
        height: clamp(300px, 44vw, 380px);
        min-height: 0;
        max-height: 380px;
    }

    .panel--row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .mini-card {
        overflow: hidden;
    }

    .donut-widget {
        width: 100%;
        grid-template-columns: minmax(130px, 0.85fr) minmax(0, 1fr);
        gap: 14px;
    }

    .chart-frame--donut {
        width: 100%;
        height: clamp(180px, 28vw, 230px);
        min-height: 0;
    }

    .donut-legend {
        min-width: 0;
    }

    .campaign-performance {
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .campaign-performance__row {
        width: 100%;
        min-width: 0;
    }

    .conversion-funnel {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        justify-items: stretch;
    }

    .conversion-funnel__shape {
        width: min(100%, 360px);
        max-width: none;
    }

    .conversion-funnel__legend {
        width: 100%;
    }

    .priority-matrix {
        width: 100%;
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .priority-matrix__plot {
        width: 100%;
        min-width: 0;
    }

    .priority-matrix__quadrant {
        min-width: 0;
    }
}

@media (max-width: 680px) {
    .panel--lead-evolution .chart--line {
        height: 320px !important;
    }

    .chart-frame--sector {
        height: 340px;
        min-height: 0;
        max-height: 340px;
    }

    .panel--row {
        grid-template-columns: 1fr;
    }

    .donut-widget {
        grid-template-columns: 1fr;
    }

    .chart-frame--donut {
        height: 220px;
        min-height: 0;
    }

    .panel--campaign-performance,
    .panel--conversion-funnel,
    .panel--priority-matrix {
        padding: 16px;
    }

    .campaign-performance__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .campaign-metric {
        min-width: 0;
    }

    .conversion-funnel__shape {
        width: 100%;
    }

    .conversion-funnel__row {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .priority-matrix {
        grid-template-columns: 24px minmax(0, 1fr);
        grid-template-rows: minmax(260px, auto) 30px;
        gap: 6px;
        min-height: 0;
    }

    .priority-matrix__plot {
        gap: 6px;
    }

    .priority-matrix__quadrant {
        min-height: 124px;
        padding: 10px 8px;
    }

    .priority-matrix__quadrant h4 {
        font-size: 0.62rem;
        line-height: 1.12;
    }

    .priority-matrix__quadrant p,
    .priority-matrix__action,
    .priority-matrix__axis,
    .priority-matrix__axis strong {
        font-size: 0.58rem;
    }

    .priority-matrix__action {
        gap: 4px;
    }

    .priority-matrix__action svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 380px) {
    .campaign-performance__row {
        grid-template-columns: 1fr;
    }
}

/* Importación Excel: tabla editable de validación */
.import-validation-table-wrap {
    width: min(100%, 1120px);
    max-height: 46vh;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.55);
    margin-top: 1rem;
}

.import-validation-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.import-validation-table th,
.import-validation-table td {
    padding: 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    vertical-align: top;
}

.import-validation-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #0f172a;
    color: #cbd5e1;
    text-align: left;
    white-space: nowrap;
}

.import-validation-table input {
    width: 180px;
    min-height: 36px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.48);
    color: #f8fafc;
    padding: 0.45rem 0.55rem;
    outline: none;
}

.import-validation-table input:focus {
    border-color: rgba(37, 99, 235, 0.85);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.import-validation-table .cell-error input {
    border-color: rgba(239, 68, 68, 0.85);
    background: rgba(127, 29, 29, 0.16);
}

.import-validation-table .cell-error small {
    display: block;
    margin-top: 0.3rem;
    max-width: 180px;
    color: #fca5a5;
    line-height: 1.25;
}

.import-validation-table tr.has-errors td:first-child {
    color: #fca5a5;
    font-weight: 700;
}

.lead-form-modal__footer--import {
    margin-top: 1rem;
    justify-content: flex-end;
}

/* Mail accounts / campaign dynamic configuration */
.mail-config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.mail-config-card,
.mail-connected-panel,
.mail-account-card,
.campaign-helper-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    padding: 16px;
}

.mail-config-card h4,
.mail-connected-panel h4,
.campaign-helper-card h4 {
    margin: 0 0 8px;
    color: #fff;
}

.mail-config-inline,
.campaign-three {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.campaign-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mail-actions-row,
.mail-connected-header,
.mail-account-actions,
.campaign-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.mail-provider-result,
.mail-status,
.campaign-status-message {
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,.06);
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.45;
}

.mail-provider-result:empty,
.mail-status:empty,
.campaign-status-message:empty {
    display: none;
}

.mail-provider-result strong,
.mail-provider-result span {
    display: block;
}

.mail-provider-result p {
    margin: 6px 0 0;
    color: #94a3b8;
}

.mail-status--success,
.campaign-status-message--success {
    color: #bbf7d0;
    background: rgba(34,197,94,.14);
    border: 1px solid rgba(34,197,94,.25);
}

.mail-status--error,
.campaign-status-message--error {
    color: #fecaca;
    background: rgba(248,113,113,.14);
    border: 1px solid rgba(248,113,113,.25);
}

.mail-status--warning,
.campaign-status-message--warning {
    color: #fef3c7;
    background: rgba(250,204,21,.14);
    border: 1px solid rgba(250,204,21,.24);
}

.mail-accounts-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.mail-account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mail-account-card p,
.mail-empty,
.campaign-muted {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

.mail-account-state,
.mail-default-badge,
.campaign-small-badge {
    display: inline-flex;
    margin-top: 8px;
    margin-right: 6px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(148,163,184,.16);
    color: #cbd5e1;
}

.mail-account-state.is-active,
.mail-default-badge,
.campaign-small-badge.is-active {
    background: rgba(34,197,94,.16);
    color: #86efac;
}

.mail-account-state.is-failed {
    background: rgba(248,113,113,.16);
    color: #fecaca;
}

.mail-default-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}

.mail-default-check input {
    width: auto !important;
}

.campaign-helper-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.campaign-primary[aria-disabled="true"] {
    opacity: .55;
    pointer-events: none;
}

@media (max-width: 980px) {
    .mail-config-grid,
    .campaign-helper-grid,
    .campaign-three {
        grid-template-columns: 1fr;
    }

    .mail-account-card {
        align-items: flex-start;
        flex-direction: column;
    }
}
