:root {
    --sidebar-width: 260px;
    --color-canvas: #f8fafc;
    --color-heading: #101827;
    --color-text: #334155;
    --color-muted: #66758a;
    --color-border: #e4e9ef;
    --color-gold: #f6b800;
    --radius-card: 14px;
    --shadow-card: 0 6px 20px rgba(15, 23, 42, 0.045);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--color-text);
    background: var(--color-canvas);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--color-canvas);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--color-text);
    background: var(--color-canvas);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(118, 81, 216, 0.28);
    outline-offset: 2px;
}

h1:focus {
    outline: none;
}

::selection {
    color: #111827;
    background: #ffe08a;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #eef2f6;
}

::-webkit-scrollbar-thumb {
    border: 2px solid #eef2f6;
    border-radius: 10px;
    background: #bdc6d2;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #c81e1e;
}

.blazor-error-boundary {
    border-radius: 10px;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "Ha ocurrido un error.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Campaign visual system: hierarchy, soft accents and restrained emphasis. */
body .detail-page .title-row h1,
body .wizard-page h1 {
    font-weight: 800;
    letter-spacing: -.035em;
}

body .detail-page .state,
body .detail-page .tabs button,
body .wizard-page .steps button {
    font-weight: 500;
}

body .detail-page .actions button,
body .detail-page .tabs .active,
body .wizard-page .steps .current,
body .wizard-page .activate,
body .wizard-page .primary {
    font-weight: 700;
}

body .detail-page .detail-header p,
body .detail-page .detail-header small,
body .detail-page .preparation p,
body .wizard-page header p,
body .wizard-page .lead,
body .wizard-page header aside {
    font-weight: 400;
}

body .detail-page .preparation,
body .detail-page .panel,
body .detail-page .quick,
body .wizard-page .form-card,
body .wizard-page .summary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-color: #dde4ee;
    box-shadow: 0 10px 30px #101b360c;
}

body .detail-page .preparation::after,
body .detail-page .panel::after,
body .detail-page .quick::after,
body .wizard-page .form-card::after,
body .wizard-page .summary::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: #f0e9ff;
    opacity: .46;
    pointer-events: none;
}

body .detail-page .preparation::after,
body .wizard-page .form-card::after,
body .wizard-page .summary::after {
    right: -58px;
    top: -72px;
}

body .detail-page .panel::after,
body .detail-page .quick::after {
    right: -58px;
    bottom: -72px;
}

body .detail-page .quick::after { background: #eaf7f0; }
body .wizard-page .summary::after { background: #fff2cf; }

body .detail-page .panel h2,
body .detail-page .quick h2,
body .wizard-page .form-card h2,
body .wizard-page .summary h3 {
    font-weight: 750;
    letter-spacing: -.015em;
}

body .detail-page .funnel span { font-weight: 500; }
body .detail-page .quick small,
body .wizard-page .form-card label { font-weight: 600; }
body .detail-page .quick b,
body .wizard-page .check b,
body .wizard-page .sequence b,
body .wizard-page .review b,
body .wizard-page .final-grid b,
body .wizard-page .summary b { font-weight: 650; }

body .detail-page .quick span,
body .wizard-page input,
body .wizard-page textarea,
body .wizard-page select,
body .wizard-page small,
body .wizard-page .sequence em,
body .wizard-page .summary p { font-weight: 400; }

body .wizard-page .form-card {
    border-left: 4px solid #754bd8;
}

body .wizard-page .review div,
body .wizard-page .final-grid div {
    border: 1px solid #edf0f5;
    background: #fbfcfe;
}

body .wizard-page .sequence.selected {
    border-width: 1px;
    border-left: 4px solid #f3bd18;
    background: linear-gradient(100deg, #fffaf0, #fff);
}

body .wizard-page .activate-box {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #f7f3ff, #fff);
}

body .detail-page .actions .danger {
    color: #b42335;
    border-color: #f0cbd1;
    background: #fffafb;
}

body .detail-page .actions .danger:hover {
    background: #fff0f2;
    border-color: #e5aeb7;
}

body .detail-page .delete-confirm {
    margin: 20px 0 4px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid #efc4cb;
    border-left: 4px solid #c9364c;
    border-radius: 12px;
    background: linear-gradient(105deg, #fff7f8, #fff);
    box-shadow: 0 9px 24px #9d263711;
}

body .detail-page .delete-confirm > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body .detail-page .delete-confirm strong { font-weight: 700; }
body .detail-page .delete-confirm span { color: #6d5860; font-size: 13px; font-weight: 400; }
body .detail-page .delete-actions { display: flex; gap: 9px; flex: 0 0 auto; }

body .detail-page .delete-actions button {
    padding: 10px 14px;
    border: 1px solid #d9e1eb;
    border-radius: 8px;
    background: #fff;
    font-weight: 600;
}

body .detail-page .delete-actions .confirm-danger {
    color: #fff;
    border-color: #b42335;
    background: #b42335;
}

@media (max-width: 750px) {
    body .detail-page .delete-confirm { align-items: flex-start; flex-direction: column; }
}

/* Shared semantic button palette. Navigation, tabs and quiet controls stay neutral. */
body button.primary,
body button.dark,
body button.activate,
body button.open,
body button.success,
body button.danger,
body button.confirm-danger,
body button.campaign-button {
    border: 0;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

body button.dark,
body button.activate,
body button.open,
body button.campaign-button {
    background: linear-gradient(135deg, #6040c5, #865fe0);
    box-shadow: 0 8px 18px #6942cd38;
}

body .campaign-page button.primary,
body .wizard-page button.primary {
    color: #172036;
    background: linear-gradient(135deg, #ffd75d, #efb510);
    box-shadow: 0 8px 18px #e5aa1638;
}

body button.success {
    color: #fff;
    background: linear-gradient(135deg, #078b50, #18b66d);
    box-shadow: 0 8px 18px #07945532;
}

body button.danger,
body button.confirm-danger,
body .detail-page .actions button.danger,
body .detail-page .delete-actions button.confirm-danger {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #ad2439, #dc4a5f);
    box-shadow: 0 8px 18px #b4233530;
}

body button.secondary,
body button.report-button {
    color: #29384c;
    border: 1px solid #d9e1eb;
    background: #fff;
    box-shadow: 0 3px 10px #0f172a0a;
}

body button.primary:hover,
body button.dark:hover,
body button.activate:hover,
body button.open:hover,
body button.success:hover,
body button.danger:hover,
body button.confirm-danger:hover,
body button.campaign-button:hover {
    filter: saturate(1.05) brightness(1.02);
    transform: translateY(-2px);
}

body button.primary:active,
body button.dark:active,
body button.activate:active,
body button.open:active,
body button.success:active,
body button.danger:active,
body button.confirm-danger:active,
body button.campaign-button:active {
    transform: translateY(0);
}

body button:disabled {
    cursor: not-allowed;
    filter: grayscale(.15);
    opacity: .58;
    transform: none;
    box-shadow: none;
}

/* Consistent campaign form geometry and dashboard-scale typography. */
body .wizard-page {
    font-size: 14px;
}

body .wizard-page h1 {
    font-size: 32px;
    line-height: 1.12;
}

body .wizard-page .form-card h2 { font-size: 22px; }
body .wizard-page .summary h3 { font-size: 18px; }
body .wizard-page .lead { font-size: 14px; line-height: 1.55; }
body .wizard-page .steps button { font-size: 14px; }
body .wizard-page .wizard-shell { align-items: start; }
body .wizard-page .form-card,
body .wizard-page .summary { border-radius: 16px; }

body .wizard-page .form-card input:not([type="checkbox"]),
body .wizard-page .form-card textarea,
body .wizard-page .form-card select {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    padding: 11px 13px;
    color: #18233d;
    background: #fff;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body .wizard-page .form-card textarea { min-height: 110px; resize: vertical; }

body .wizard-page .form-card input:not([type="checkbox"]):hover,
body .wizard-page .form-card textarea:hover,
body .wizard-page .form-card select:hover {
    border-color: #bfb1ea;
    background: #fdfcff;
}

body .wizard-page .form-card input:not([type="checkbox"]):focus,
body .wizard-page .form-card textarea:focus,
body .wizard-page .form-card select:focus {
    border-color: #805bdd;
    box-shadow: 0 0 0 3px #754bd81a;
}

body .wizard-page .two > div,
body .wizard-page .review > div,
body .wizard-page .final-grid > div {
    min-width: 0;
}

body button.secondary:hover,
body button.report-button:hover,
body .detail-page .actions button.secondary:hover {
    color: #6842cb;
    border-color: #c8b9ef;
    background: linear-gradient(135deg, #fff, #f6f2ff);
    box-shadow: 0 8px 18px #6842cb18;
    transform: translateY(-2px);
}

body button.back {
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 7px 10px;
    font-weight: 500;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

body button.back:hover {
    color: #6842cb;
    border-color: #d8cff1;
    background: linear-gradient(135deg, #fff, #f4efff);
    transform: translateX(-2px);
}

/* Dashboard and campaign cards share the same elevation language. */
body .dashboard-page .table-header button {
    color: #6842cb;
    border-color: #d6ccef;
    background: linear-gradient(135deg, #fff, #f4efff);
    box-shadow: 0 6px 16px #6842cb12;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

body .dashboard-page .table-header button:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #6040c5, #865fe0);
    box-shadow: 0 10px 22px #6842cb32;
    transform: translateY(-2px);
}

body .campaign-page .campaign-kpis article,
body .detail-page .detail-kpis article {
    border-color: #dce3ed;
    box-shadow: 0 11px 27px #101b3616;
}

body .campaign-page .campaign-kpis article:hover,
body .detail-page .detail-kpis article:hover {
    border-color: #cfc3ed;
    box-shadow: 0 15px 34px #6842cb20;
}

/* Softer detail-page hierarchy. */
body .detail-page { font-size: 14px; }
body .detail-page .detail-header { align-items: flex-start; }
body .detail-page .title-row { align-items: center; }
body .detail-page .title-row h1 {
    max-width: 720px;
    font-size: 30px;
    line-height: 1.16;
    font-weight: 750;
    letter-spacing: -.03em;
}

body .detail-page .detail-header p {
    margin: 13px 0 11px;
    font-size: 14px;
    line-height: 1.55;
}

body .detail-page .campaign-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

body .detail-page .campaign-meta .state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 650;
}

body .detail-page .campaign-meta small { color: #69768b; font-size: 12px; }
body .detail-page .actions { flex-wrap: wrap; justify-content: flex-end; }
body .detail-page .actions button { min-height: 42px; padding: 10px 13px; font-size: 13px; }
body .detail-page .tabs button { font-size: 14px; }

body .detail-page .detail-grid {
    align-items: stretch;
}

body .detail-page .detail-grid > .panel {
    height: 360px;
    box-sizing: border-box;
}

body .detail-page .interactive-panel {
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body .detail-page .interactive-panel:hover {
    border-color: #cfc3ed;
    box-shadow: 0 14px 32px #6842cb1c;
    transform: translateY(-2px);
}

body .detail-page .panel h2,
body .detail-page .quick h2 { font-size: 17px; }
body .detail-page .funnel span { font-size: 13px; }

/* Campaign table links preserve the row layout while expanding the hit target. */
body .campaign-page .campaign-link {
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

body .campaign-page .campaign-link > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

body .campaign-page .campaign-link strong { transition: color 150ms ease; }
body .campaign-page .campaign-link:hover strong { color: #6842cb; }

/* Reusable data-table freezing pattern; opt in per table. */
body .standard-data-table {
    border-collapse: separate;
    border-spacing: 0;
}

body .standard-data-table thead th {
    position: sticky;
    z-index: 4;
    top: 0;
    border-bottom: 1px solid #e8edf4;
    background: #f8fafc;
}

body .standard-data-table.sticky-primary-column th:first-child,
body .standard-data-table.sticky-primary-column td:first-child {
    position: sticky;
    left: 0;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    box-sizing: border-box;
    border-right: 1px solid #e7ebf1;
    background: #fff;
}

body .standard-data-table.sticky-primary-column thead th:first-child {
    z-index: 6;
    background: #f8fafc;
}

body .standard-data-table.sticky-primary-column tbody td:first-child {
    z-index: 3;
}

body .standard-data-table.sticky-primary-column tbody tr:hover td:first-child {
    background: #fbf9ff;
}

body .standard-data-table.sticky-secondary-column th:first-child,
body .standard-data-table.sticky-secondary-column td:first-child {
    position: sticky;
    z-index: 3;
    left: 0;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    box-sizing: border-box;
    background: #fff;
}

body .standard-data-table.sticky-secondary-column th:nth-child(2),
body .standard-data-table.sticky-secondary-column td:nth-child(2) {
    position: sticky;
    z-index: 3;
    left: 58px;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    box-sizing: border-box;
    border-right: 1px solid #e7ebf1;
    background: #fff;
}

body .standard-data-table.sticky-secondary-column thead th:first-child,
body .standard-data-table.sticky-secondary-column thead th:nth-child(2) {
    z-index: 6;
    background: #f8fafc;
}

body .standard-data-table.sticky-secondary-column tbody tr:hover td:first-child,
body .standard-data-table.sticky-secondary-column tbody tr:hover td:nth-child(2),
body .standard-data-table.sticky-secondary-column tbody tr.selected td:first-child,
body .standard-data-table.sticky-secondary-column tbody tr.selected td:nth-child(2) {
    background: #fbf9ff;
}

/* Reusable freezing pattern for tabular CSS-grid lists. */
body .standard-grid-table-scroll {
    max-height: 650px;
    overflow: auto;
}

body .standard-grid-header {
    position: sticky;
    z-index: 4;
    top: 0;
    background: #f8fafc;
}

body .sticky-grid-primary > :first-child {
    position: sticky;
    z-index: 3;
    left: 0;
    box-sizing: border-box;
    border-right: 1px solid #e7ebf1;
    background: #fff;
}

body .standard-grid-header.sticky-grid-primary > :first-child {
    z-index: 6;
    background: #f8fafc;
}

body .standard-grid-row:hover > :first-child {
    background: #fbf9ff;
}
body .campaign-page .status-link { border: 0; font: inherit; cursor: pointer; }
body .campaign-page .status-link:hover { filter: saturate(1.08) brightness(.98); box-shadow: 0 5px 12px #101b3612; }

@media (max-width: 1100px) {
    body .detail-page .title-row h1 { max-width: 540px; font-size: 28px; }
    body .detail-page .detail-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body .detail-page .detail-grid { grid-template-columns: 1fr; }
    body .detail-page .detail-grid > .panel { height: auto; min-height: 350px; }
    body .campaign-page th:nth-child(7), body .campaign-page td:nth-child(7),
    body .campaign-page th:nth-child(8), body .campaign-page td:nth-child(8),
    body .campaign-page th:nth-child(9), body .campaign-page td:nth-child(9) { display: none; }
    body .campaign-page table { min-width: 820px; }
}

@media (max-width: 760px) {
    body .detail-page { padding: 22px 16px; }
    body .detail-page .detail-header { gap: 18px; }
    body .detail-page .title-row { align-items: flex-start; }
    body .detail-page .title-row h1 { max-width: none; font-size: 25px; }
    body .detail-page .actions { width: 100%; justify-content: flex-start; }
    body .detail-page .actions button { flex: 1 1 auto; }
    body .detail-page .detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body .detail-page .tabs { gap: 2px; overflow-x: auto; white-space: nowrap; }
    body .detail-page .tabs button { padding-inline: 13px; }
    body .detail-page .quick { grid-template-columns: 1fr; }
    body .campaign-page { padding: 24px 16px; }
    body .campaign-page .campaign-header h1 { font-size: 30px; }
    body .campaign-page th:nth-child(3), body .campaign-page td:nth-child(3),
    body .campaign-page th:nth-child(5), body .campaign-page td:nth-child(5),
    body .campaign-page th:nth-child(6), body .campaign-page td:nth-child(6),
    body .campaign-page th:nth-child(7), body .campaign-page td:nth-child(7),
    body .campaign-page th:nth-child(8), body .campaign-page td:nth-child(8),
    body .campaign-page th:nth-child(9), body .campaign-page td:nth-child(9) { display: none; }
    body .campaign-page table { min-width: 620px; }
}

@media (max-width: 480px) {
    body .detail-page .detail-kpis { grid-template-columns: 1fr; }
    body .detail-page .campaign-meta { align-items: flex-start; flex-direction: column; }
    body .campaign-page table { min-width: 560px; }
}

/* Informational indicators lift on hover but remain non-interactive. */
body .campaign-page .campaign-kpis article,
body .detail-page .detail-kpis article {
    cursor: default;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body .campaign-page .campaign-kpis article:hover,
body .detail-page .detail-kpis article:hover {
    transform: translateY(-4px);
    border-color: #cfc3ed;
    box-shadow: 0 17px 36px #6842cb22;
}

/* Keep destructive intent visible throughout hover; overrides older quiet-button rules. */
body .detail-page .actions button.danger,
body .detail-page .actions button.danger:hover,
body .detail-page .delete-actions button.confirm-danger,
body .detail-page .delete-actions button.confirm-danger:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #a91f35, #df4b61);
    box-shadow: 0 10px 22px #b4233540;
}

/* Typography shared with the main dashboard. */
body .campaign-page .campaign-header h1,
body .wizard-page h1,
body .detail-page .title-row h1 {
    margin: 0;
    color: var(--color-heading);
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    font-weight: 780;
    letter-spacing: -.045em;
    line-height: 1.12;
}

body .campaign-page .campaign-header p,
body .wizard-page header p,
body .detail-page .detail-header p {
    color: var(--color-muted);
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.5;
}

body .campaign-page .eyebrow,
body .wizard-page .page-kicker,
body .detail-page .page-kicker {
    color: #9a7100;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

body .campaign-page .table-toolbar h2,
body .wizard-page .form-card h2,
body .wizard-page .summary h3,
body .detail-page .panel h2,
body .detail-page .quick h2 {
    color: var(--color-heading);
    font-size: 1.08rem;
    font-weight: 720;
    letter-spacing: -.02em;
}

body .campaign-page .campaign-kpis small,
body .detail-page .detail-kpis small {
    font-size: .78rem;
    font-weight: 650;
}

body .campaign-page .campaign-kpis strong,
body .detail-page .detail-kpis strong {
    font-size: clamp(1.55rem, 2vw, 1.9rem);
    font-weight: 780;
    letter-spacing: -.035em;
}

body .campaign-page .campaign-kpis span:last-child,
body .detail-page .detail-kpis em {
    font-size: .73rem;
    font-weight: 400;
}

body .campaign-page th {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .045em;
}

body .campaign-page td,
body .campaign-page .filters input,
body .campaign-page .filters select,
body .wizard-page,
body .detail-page {
    font-size: .78rem;
}

body .campaign-page .campaign-name strong { font-size: .8rem; font-weight: 700; }
body .campaign-page .campaign-name small { font-size: .69rem; font-weight: 400; }
body .campaign-page .status { font-size: .69rem; font-weight: 650; cursor: default; }

body .campaign-page .status:hover {
    filter: none;
    box-shadow: none;
    transform: none;
}

body .detail-page .actions button.danger:hover,
body .detail-page .delete-actions button.confirm-danger:hover {
    filter: saturate(1.08) brightness(1.04);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    body .detail-page .detail-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    body .detail-page .detail-kpis article {
        min-height: 140px;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    body .detail-page .detail-kpis article > span {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    body .detail-page .detail-kpis article > div {
        width: 100%;
    }

    body .detail-page .detail-kpis small,
    body .detail-page .detail-kpis em {
        white-space: normal;
    }
}

/* Olei Ads action-button system: the only four sanctioned visual variants. */
:root {
    --olei-button-height: 40px;
    --olei-button-radius: 9px;
    --olei-button-padding-x: 14px;
    --olei-button-gap: 7px;
    --olei-button-font-size: 12px;
    --olei-button-font-weight: 650;
    --olei-button-purple: #754bd8;
    --olei-button-purple-hover: #6840c7;
    --olei-button-yellow: #f1c644;
    --olei-button-yellow-hover: #e8ba2c;
    --olei-button-ink: #17233f;
    --olei-button-danger: #b42335;
    --olei-button-border: #d8cff0;
    --olei-button-danger-border: #e4b8bf;
    --olei-button-hover-shadow: 0 8px 18px rgba(15, 23, 42, .16);
    --olei-button-pressed-shadow: 0 3px 8px rgba(15, 23, 42, .10);
    --olei-button-transition: transform 160ms ease, box-shadow 160ms ease;
}

/* Dropdown options, navigation, tabs and wizard step selectors are structural
   controls. Every remaining button defaults to the official secondary style. */
body :where(button:not(.filter-dropdown button):not(.tabs button):not(.steps button):not([role="option"]):not(.account-popover button):not(.nav-item):not(.oa-button-exempt)),
body :where(a.primary-action, a.secondary-action, a.secondary, a.company-link, a.compliance-link, a.back, a.reload, a.oa-button) {
    box-sizing: border-box !important;
    min-width: 0;
    height: var(--olei-button-height) !important;
    min-height: var(--olei-button-height) !important;
    max-height: var(--olei-button-height);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--olei-button-gap) !important;
    border: 1px solid var(--olei-button-border) !important;
    border-radius: var(--olei-button-radius) !important;
    padding: 0 var(--olei-button-padding-x) !important;
    color: var(--olei-button-purple) !important;
    background: #fff !important;
    filter: none !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: var(--olei-button-font-size) !important;
    font-weight: var(--olei-button-font-weight) !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--olei-button-transition) !important;
}

/* Purple: execute, confirm, continue and open. */
body :is(
    button.primary, button.primary-button, button.primary-action, button.dark,
    button.activate, button.open, button.success, button.campaign-button, button.publish,
    button.send-button, button.confirm, button[type="submit"],
    .drawer-nav button:last-child, .metric-custom-period button,
    .oa-button--purple
):where(:not(.filter-dropdown button):not(.tabs button):not(.steps button):not(.account-popover button):not([role="option"])),
body :is(a.primary-action, a.oa-button--purple) {
    border-color: var(--olei-button-purple) !important;
    color: #fff !important;
    background: var(--olei-button-purple) !important;
}

/* Yellow: create, add and invite. */
body :is(
    .campaign-header button.primary, .content-header button.primary,
    .templates-header button.primary, button.oa-button--yellow,
    button.add-variant, a.oa-button--yellow
) {
    border-color: var(--olei-button-yellow) !important;
    color: var(--olei-button-ink) !important;
    background: var(--olei-button-yellow) !important;
}

/* White/purple: secondary, navigation and icon actions. */
body :is(
    button.secondary, button.secondary-button, button.secondary-action,
    button.report-button, button.back, button.clear, button.clear-button,
    button.more, button.row-action, button.detail-close, button.nav-arrow,
    button.icon-action, button.tour-skip, .pager button, .table-footer button,
    .template-list .actions > button, .content-card .card-actions .more,
    .ai-modal > header button, .dialog button:not(.danger-button),
    .delete-actions button:not(.confirm-danger), .oa-button--secondary
):where(:not(.filter-dropdown button):not(.tabs button):not(.steps button):not([role="option"])),
body :is(a.secondary-action, a.secondary, a.company-link, a.compliance-link, a.back, a.oa-button--secondary) {
    border-color: var(--olei-button-border) !important;
    color: var(--olei-button-purple) !important;
    background: #fff !important;
}

/* White/red: destructive or irreversible actions only. */
body :is(
    button.danger, button.danger-action, button.danger-button,
    button.confirm-danger, button.delete, button.remove,
    button.icon-action[title^="Eliminar"], .location-chips button,
    .selected-industries button, button.oa-button--danger,
    a.oa-button--danger
):where(:not(.filter-dropdown button):not(.tabs button):not(.steps button):not([role="option"])) {
    border-color: var(--olei-button-danger-border) !important;
    color: var(--olei-button-danger) !important;
    background: #fff !important;
}

/* Icon-only actions use the same geometry and interaction language. */
body :is(
    button.more, button.detail-close, button.nav-arrow, button.icon-action, button.remove,
    .ai-modal > header button, .toast > button, .help-window > header > button,
    .help-data-heading > button
) {
    width: var(--olei-button-height) !important;
    min-width: var(--olei-button-height) !important;
    flex: 0 0 var(--olei-button-height) !important;
    padding: 0 !important;
}

/* Dropdown choices deliberately remain menu items, not rectangular buttons. */
body :is(.menu, .action-menu, .filter-dropdown-options, .account-popover) button {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    border: 0 !important;
    border-radius: 7px !important;
    padding: 8px 10px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}
body :is(.menu, .action-menu) button { color: var(--olei-button-purple); }
body :is(.menu, .action-menu) button:is(.danger, .delete) { color: var(--olei-button-danger); }
body .account-popover button {
    width: 100% !important;
    color: #eaf0f7 !important;
    background: transparent !important;
    text-align: left !important;
}
body .account-popover button:not(:disabled):hover {
    background: rgba(255, 255, 255, .055) !important;
}
body :where(button:not(.filter-dropdown button):not(.tabs button):not(.steps button):not([role="option"]):not(.account-popover button):not(.nav-item):not(.oa-button-exempt):not(:disabled):hover),
body :where(a.primary-action, a.secondary-action, a.secondary, a.company-link, a.compliance-link, a.back, a.reload, a.oa-button):hover {
    box-shadow: var(--olei-button-hover-shadow) !important;
    filter: none !important;
    transform: translateY(-2px) !important;
}

body :where(button:not(.filter-dropdown button):not(.tabs button):not(.steps button):not([role="option"]):not(.account-popover button):not(.nav-item):not(.oa-button-exempt):not(:disabled):active),
body :where(a.primary-action, a.secondary-action, a.secondary, a.company-link, a.compliance-link, a.back, a.reload, a.oa-button):active {
    box-shadow: var(--olei-button-pressed-shadow) !important;
    transform: translateY(0) !important;
}
body button:disabled {
    cursor: not-allowed !important;
    opacity: .52 !important;
    transform: none !important;
    box-shadow: none !important;
}
body button:focus-visible,
body :is(a.primary-action, a.secondary-action, a.secondary, a.company-link, a.compliance-link, a.back, a.reload, a.oa-button):focus-visible {
    outline: 3px solid rgba(117, 75, 216, .24) !important;
    outline-offset: 2px !important;
}

/* Cards stay visually neutral: remove only the decorative color circles. */
body :is(
    .stat-card,
    .kpi,
    .metric,
    .detail-page .preparation,
    .detail-page .panel,
    .detail-page .quick,
    .wizard-page .form-card,
    .wizard-page .summary,
    .editor-page .preview-card
)::after,
body .campaign-page .table-card::before,
body .editor-page .preview-art::before {
    display: none !important;
    content: none !important;
}

/* Active campaign card keeps its layout and border, without the purple left accent. */
body .campaign-card::before {
    display: none !important;
    content: none !important;
}
html[dir="rtl"] body{direction:rtl}
html[dir="rtl"] .app-shell{direction:rtl}
html[dir="rtl"] .sidebar{order:2}

/* Floating controls are appended to document.body by the email editor. */
.image-size-controls{position:fixed;z-index:1000;display:grid;width:280px;height:48px;grid-template-columns:auto 1fr 42px;align-items:center;gap:10px;border:1px solid #d9dfea;border-radius:11px;padding:0 12px;color:#26364b;background:#fff;box-shadow:0 12px 34px rgba(16,27,54,.19);font-family:Inter,"Segoe UI",sans-serif}.image-size-controls span{font-size:.7rem;font-weight:750}.image-size-controls input{width:100%;accent-color:#754bd8}.image-size-controls output{color:#6840c7;font-size:.7rem;font-weight:750;text-align:right}
html[dir="rtl"] .app-main{order:1}
html[dir="rtl"] input,html[dir="rtl"] textarea,html[dir="rtl"] select{direction:rtl;text-align:right}

/* Los controles desplegables comunican claramente que toda su superficie es
   interactiva. Los campos de escritura conservan el cursor de texto. */
select:not(:disabled),button[aria-haspopup="listbox"]:not(:disabled){cursor:pointer}
select:disabled{cursor:not-allowed}

/* Navegacion de Configuracion: respaldo global para conservar el aspecto de
   pestanas incluso durante una recarga incremental de estilos aislados. */
body .settings-tabs{display:flex;align-items:flex-end;gap:6px;margin:0 0 28px;padding:0 6px;border-bottom:1px solid #dce3ee}
body .settings-tabs a{position:relative;margin-bottom:-1px;padding:12px 22px;border:1px solid transparent;border-bottom:0;border-radius:13px 13px 0 0;color:#68758c;background:transparent;font-size:.82rem;font-weight:750;line-height:1;text-decoration:none;transition:color .18s ease,background-color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease}
body .settings-tabs a:hover{color:#6840c7;background:#faf8ff;transform:translateY(-2px)}
body .settings-tabs a.active{z-index:1;color:#17233f;border-color:#dce3ee;background:#fff;box-shadow:0 -7px 18px rgba(33,43,70,.055);transform:translateY(0)}
body .settings-tabs a.active:before{position:absolute;top:0;right:16px;left:16px;height:3px;border-radius:0 0 4px 4px;background:linear-gradient(90deg,#754bd8,#9363e5);content:""}
@media(max-width:560px){body .settings-tabs{overflow-x:auto;padding-top:3px}body .settings-tabs a{padding:11px 17px;white-space:nowrap}}
.route-error{max-width:760px;margin:70px auto;border:1px solid #efd18a;border-radius:20px;padding:34px;background:#fffaf0;box-shadow:0 18px 45px #18223b12;color:#17233f}.route-error>span{color:#9a6d00;font-size:.75rem;font-weight:850;letter-spacing:.14em}.route-error h1{margin:10px 0;font-size:2rem}.route-error p{color:#68758c;line-height:1.55}.route-error code{display:block;overflow-wrap:anywhere;border-radius:10px;padding:14px;color:#7e2431;background:#fff0f2;white-space:pre-wrap}.route-error button{margin-top:18px;border:0;border-radius:10px;padding:12px 18px;color:#fff;background:#754bd8;font:inherit;font-weight:750;cursor:pointer}

/* Current Dashboard visual system: shared by authenticated modules and subviews. */
:root {
    --olei-page-title-size: clamp(1.18rem, 1.92vw, 1.63rem);
    --olei-page-title-weight: 780;
    --olei-page-title-line-height: 1.12;
    --olei-page-title-spacing: -0.045em;
    --olei-page-kicker-size: 0.58rem;
    --olei-page-copy-size: 0.75rem;
    --olei-page-kicker-gap: 4px;
    --olei-page-copy-gap: 4px;
    --olei-section-gap: 15px;
    --olei-card-radius: var(--radius-card);
    --olei-card-border: var(--color-border);
    --olei-card-shadow: var(--shadow-card);
    --olei-card-hover-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
    --olei-card-transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    --olei-kpi-height: 92px;
    --olei-kpi-height-compact: 90px;
    --olei-kpi-padding: 11px 16px;
    --olei-kpi-padding-compact: 10px 15px;
    --olei-kpi-gap: 11px;
    --olei-kpi-icon-size: 40px;
    --olei-kpi-icon-radius: 12px;
}

body :is(
    .campaign-header,
    .prospects-header,
    .responses-header,
    .content-header,
    .templates-header,
    .composer-header,
    .editor-page > header,
    .detail-header,
    .settings-layout-header,
    .account-header-shell > header,
    .wizard-page > header
) h1 {
    margin: 0 !important;
    color: var(--color-heading) !important;
    font-size: var(--olei-page-title-size) !important;
    font-weight: var(--olei-page-title-weight) !important;
    letter-spacing: var(--olei-page-title-spacing) !important;
    line-height: var(--olei-page-title-line-height) !important;
}

body :is(.setup-card > header, .prepare-main, .security-card) h1 {
    color: var(--color-heading) !important;
    font-size: var(--olei-page-title-size) !important;
    font-weight: var(--olei-page-title-weight) !important;
    letter-spacing: var(--olei-page-title-spacing) !important;
    line-height: var(--olei-page-title-line-height) !important;
}

body :is(.setup-card > header, .prepare-main, .security-card) > p {
    font-size: var(--olei-page-copy-size) !important;
    line-height: 1.5 !important;
}

body :is(
    .campaign-header,
    .prospects-header,
    .responses-header,
    .content-header,
    .templates-header,
    .composer-header,
    .editor-page > header,
    .detail-header,
    .settings-layout-header,
    .account-header-shell > header,
    .wizard-page > header
) :is(.eyebrow, .page-kicker, div > span:first-child) {
    margin-bottom: var(--olei-page-kicker-gap) !important;
    font-size: var(--olei-page-kicker-size) !important;
}

body .settings-layout-header > span,
body .account-header-shell > header > div > span:first-child {
    margin-bottom: var(--olei-page-kicker-gap) !important;
    font-size: var(--olei-page-kicker-size) !important;
}

body :is(
    .campaign-header,
    .prospects-header,
    .responses-header,
    .content-header,
    .templates-header,
    .composer-header,
    .editor-page > header,
    .detail-header,
    .settings-layout-header,
    .account-header-shell > header,
    .wizard-page > header
) p {
    margin-top: var(--olei-page-copy-gap) !important;
    margin-bottom: 0 !important;
    color: var(--color-muted) !important;
    font-size: var(--olei-page-copy-size) !important;
    line-height: 1.5 !important;
}

body :is(.settings-layout-header, .account-header-shell > header) {
    margin-top: 0 !important;
    margin-bottom: var(--olei-section-gap) !important;
}

body :is(.navigation-tabs, .settings-tabs) {
    margin-bottom: var(--olei-section-gap) !important;
}

body :is(.campaign-page, .detail-page, .wizard-page) {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body :is(.campaign-header, .prospects-header, .responses-header) {
    margin-bottom: var(--olei-section-gap) !important;
}

body :is(.content-page, .templates-page, .composer-page, .editor-page) {
    gap: var(--olei-section-gap) !important;
}

/* Shared card surface. Form, table and modal semantics remain unchanged. */
body :is(
    .settings-card,
    .preview-card,
    .profile-card,
    .section-card,
    .password-card,
    .forgot-card,
    .billing-card,
    .side-card,
    .email-editor-card,
    .form-card,
    .stage-card,
    .users-card,
    .library-card,
    .test-send-card
) {
    border-color: var(--olei-card-border) !important;
    border-radius: var(--olei-card-radius) !important;
    box-shadow: var(--olei-card-shadow) !important;
}

/* Only selectable/clickable cards receive the Dashboard interaction. */
body :is(
    .sequence,
    .theme-options label,
    .resource-card
) {
    --olei-card-accent: #7651d8;
    border-radius: var(--olei-card-radius);
    transition: var(--olei-card-transition) !important;
}

body :is(
    .sequence,
    .theme-options label,
    .resource-card
):hover {
    border-color: color-mix(in srgb, var(--olei-card-accent) 24%, var(--olei-card-border)) !important;
    box-shadow: var(--olei-card-hover-shadow) !important;
    transform: translateY(-3px) !important;
}

body .resource-card { --olei-card-accent: #1677e8; }
body .sequence { --olei-card-accent: #d99b00; }
body .theme-options label { --olei-card-accent: #7651d8; }

/* KPI instances in every module follow the exact compact Dashboard measurements. */
body :is(.campaign-kpis, .detail-kpis, .prospect-kpis, .response-kpis, .content-kpis, .template-kpis) :is(.kpi, .metric) {
    box-sizing: border-box !important;
    height: var(--olei-kpi-height) !important;
    min-height: var(--olei-kpi-height) !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: var(--olei-kpi-gap) !important;
    border-radius: var(--radius-card) !important;
    padding: var(--olei-kpi-padding) !important;
    box-shadow: var(--shadow-card) !important;
}

body .kpi:has(.blue):hover {
    border-color: color-mix(in srgb, #1677e8 24%, var(--color-border)) !important;
}

body .kpi:has(.green):hover {
    border-color: color-mix(in srgb, #0ca968 24%, var(--color-border)) !important;
}

body .kpi:has(.purple):hover {
    border-color: color-mix(in srgb, #7651d8 24%, var(--color-border)) !important;
}

body .kpi:has(.gold):hover {
    border-color: color-mix(in srgb, #d99b00 24%, var(--color-border)) !important;
}

body .kpi:hover {
    box-shadow: var(--olei-card-hover-shadow) !important;
    transform: translateY(-3px) !important;
}

body :is(.campaign-kpis, .detail-kpis, .prospect-kpis, .response-kpis, .content-kpis, .template-kpis) :is(.kpi-icon, .metric > span) {
    width: var(--olei-kpi-icon-size) !important;
    height: var(--olei-kpi-icon-size) !important;
    flex: 0 0 var(--olei-kpi-icon-size) !important;
    border-radius: var(--olei-kpi-icon-radius) !important;
}

/* Table rows stay neutral on hover; the left rail is the sole row indicator. */
body table tbody tr:hover,
body table tbody tr:hover > td,
body table tbody tr.selected,
body table tbody tr.selected > td {
    background: #fff !important;
    background-image: none !important;
}

body table tbody tr:hover > td:first-child,
body table tbody tr.selected > td:first-child {
    box-shadow: inset 3px 0 #754bd8 !important;
}

body .standard-grid-row:hover,
body .standard-grid-row:hover > :first-child {
    background: #fff !important;
    background-image: none !important;
}

body .standard-grid-row:hover {
    box-shadow: inset 3px 0 #754bd8 !important;
}

body .standard-grid-row:hover > :first-child {
    box-shadow: none !important;
}

body .content-cards .content-card:hover {
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

body .content-cards.list .content-card:hover {
    box-shadow: inset 3px 0 #754bd8 !important;
}

@media (max-width: 640px) {
    body :is(
        .campaign-header,
        .prospects-header,
        .responses-header,
        .content-header,
        .templates-header,
        .composer-header,
        .editor-page > header,
        .detail-header,
        .settings-layout-header,
        .account-header-shell > header,
        .wizard-page > header
    ) h1 {
        font-size: var(--olei-page-title-size) !important;
    }

    body :is(.campaign-kpis, .detail-kpis, .prospect-kpis, .response-kpis, .content-kpis, .template-kpis) :is(.kpi, .metric) {
        height: var(--olei-kpi-height-compact) !important;
        min-height: var(--olei-kpi-height-compact) !important;
        padding: var(--olei-kpi-padding-compact) !important;
    }
}
