:root {
    --green: #12342e;
    --green-deep: #09231f;
    --green-soft: #dfeae6;
    --mint: #8db9ad;
    --white: #ffffff;
    --paper: #f6f7f4;
    --ink: #17221f;
    --muted: #64716d;
    --line: #dce3df;
    --danger: #9f2f22;
    --danger-soft: #f9e7e3;
    --shadow: 0 24px 70px rgba(17, 52, 46, .10);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(
            circle at 80% 0,
            rgba(141, 185, 173, .14),
            transparent 34rem
        ),
        var(--paper);
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.app-header {
    min-height: 78px;
    padding: 0 clamp(22px, 5vw, 76px);
    display: flex;
    align-items: center;
    gap: 42px;
    color: var(--white);
    background: var(--green-deep);
    border-top: 4px solid #24609a;
}

.app-brand {
    display: flex;
    align-items: baseline;
    gap: 14px;
    color: var(--white);
    text-decoration: none;
    letter-spacing: .12em;
}

.app-brand strong {
    font-size: 29px;
    font-weight: 300;
}

.app-brand span {
    padding-left: 14px;
    font-size: 11px;
    border-left: 1px solid rgba(255, 255, 255, .35);
}

.app-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    margin-left: auto;
}

.app-nav a {
    padding: 0 18px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 3px solid transparent;
}

.app-nav a:hover,
.app-nav a.is-active {
    color: var(--white);
    border-bottom-color: var(--mint);
}

.app-account {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.app-account form {
    margin: 0;
}

.app-account button {
    padding: 9px 13px;
    color: var(--white);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .3);
    cursor: pointer;
}

.app-main {
    width: min(1380px, calc(100% - 44px));
    min-height: calc(100vh - 150px);
    margin: 0 auto;
    padding: clamp(38px, 6vw, 82px) 0;
}

.app-footer {
    min-height: 72px;
    padding: 0 clamp(22px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #b8c8c3;
    background: var(--green-deep);
    font-size: 12px;
}

.eyebrow {
    display: block;
    margin-bottom: 15px;
    color: #507e73;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.login-layout {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(350px, .85fr);
    gap: clamp(40px, 8vw, 120px);
    align-items: center;
}

.login-intro {
    max-width: 720px;
}

.login-intro h1 {
    max-width: 680px;
    margin: 0 0 22px;
    font-size: clamp(44px, 6vw, 84px);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.055em;
}

.login-intro p {
    max-width: 550px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.login-card {
    padding: clamp(30px, 4vw, 52px);
    background: var(--white);
    box-shadow: var(--shadow);
    border: 1px solid rgba(18, 52, 46, .08);
}

.login-card h2 {
    margin: 0 0 28px;
    font-size: 40px;
    font-weight: 400;
    letter-spacing: -.04em;
}

.login-card form {
    display: grid;
    gap: 21px;
}

.login-card label {
    display: grid;
    gap: 9px;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    color: var(--ink);
    background: #fbfcfa;
    border: 1px solid #ccd7d2;
    outline: none;
}

.login-card input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(18, 52, 46, .10);
}

.primary-button {
    min-height: 52px;
    padding: 12px 18px;
    color: var(--white);
    background: var(--green);
    border: 0;
    cursor: pointer;
    font-weight: 700;
}

.primary-button:hover {
    background: var(--green-deep);
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    font-size: 14px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-left: 3px solid var(--danger);
}

.page-heading {
    margin-bottom: 42px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.page-heading h1 {
    margin: 0 0 12px;
    font-size: clamp(42px, 5vw, 70px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.055em;
}

.page-heading p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.secure-badge,
.count-badge,
.safe-mode {
    padding: 10px 14px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 12px;
    font-weight: 700;
}

.safe-mode {
    color: #765713;
    background: #f4ead0;
}

.metrics-grid {
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric-card {
    min-height: 150px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--white);
    border: 1px solid var(--line);
}

.metric-card span {
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong {
    font-size: 44px;
    font-weight: 400;
    letter-spacing: -.05em;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.module-card {
    min-height: 310px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--white);
    text-decoration: none;
    border: 1px solid var(--line);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

a.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--mint);
    box-shadow: var(--shadow);
}

.module-card h2 {
    margin: auto 0 14px;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: -.04em;
}

.module-card p {
    min-height: 78px;
    margin: 0 0 25px;
    color: var(--muted);
    line-height: 1.6;
}

.module-card strong {
    color: var(--green);
    font-size: 13px;
}

.module-number {
    color: var(--mint);
    font-size: 12px;
    letter-spacing: .18em;
}

.module-card.is-disabled {
    opacity: .58;
}

.content-panel {
    padding: clamp(24px, 4vw, 40px);
    background: var(--white);
    border: 1px solid var(--line);
}

.secondary-panel {
    margin-top: 22px;
}

.section-heading {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-heading h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.035em;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 17px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

th {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.project-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-list span {
    padding: 11px 14px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 13px;
}

.empty-state {
    padding: 70px 25px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed #cdd8d3;
}

.empty-state h2,
.empty-state h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-weight: 400;
}

.empty-state p {
    margin: 0;
}

.empty-state.compact {
    padding: 46px 20px;
}

.notice-card {
    margin-bottom: 24px;
    padding: 20px 24px;
    color: #694f16;
    background: #f7edd5;
    border-left: 4px solid #c49a3b;
}

.notice-card p {
    margin: 7px 0 0;
    line-height: 1.5;
}

.split-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 22px;
}

.news-list {
    display: grid;
}

.news-list article {
    padding: 17px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.news-list article:first-child {
    padding-top: 0;
}

.news-list article:last-child {
    border-bottom: 0;
}

.news-list article div {
    display: grid;
    gap: 7px;
}

.news-list article strong {
    line-height: 1.35;
}

.news-list article span {
    color: var(--muted);
    font-size: 12px;
}

.status-pill {
    flex: 0 0 auto;
    padding: 7px 10px;
    color: var(--green) !important;
    background: var(--green-soft);
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    .app-header {
        flex-wrap: wrap;
        gap: 0;
        padding-top: 16px;
        padding-bottom: 12px;
    }

    .app-nav {
        width: 100%;
        order: 3;
        margin-top: 12px;
        overflow-x: auto;
    }

    .app-nav a {
        min-height: 42px;
        padding: 0 18px 0 0;
        margin-right: 18px;
        white-space: nowrap;
    }

    .app-account {
        margin-left: auto;
    }

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

    .login-layout {
        padding: 30px 0;
    }

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

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

    .module-card {
        min-height: 250px;
    }
}

@media (max-width: 620px) {
    .app-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .app-account span {
        display: none;
    }

    .app-main {
        width: min(100% - 28px, 1380px);
        padding: 34px 0 48px;
    }

    .app-footer {
        padding: 22px 18px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .login-layout {
        gap: 34px;
    }

    .login-intro h1 {
        font-size: 45px;
    }

    .login-card {
        padding: 27px 22px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-heading h1 {
        font-size: 46px;
    }

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

    .metric-card {
        min-height: 125px;
    }

    .content-panel {
        padding: 22px 17px;
    }
}

/* ALTEA CLIENTES CRUD:INICIO */
.alert-success {
    color: #164b38;
    background: #e8f4ee;
    border-color: #b8dcca;
}

.alert-info {
    color: #304d56;
    background: #edf4f5;
    border-color: #cadadd;
}

.client-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.client-form-panel {
    min-width: 0;
}

.client-form {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.client-form > label {
    display: grid;
    gap: 8px;
    color: #1b2d29;
    font-weight: 650;
}

.client-form input[type="text"],
.client-form input[type="email"],
.client-form input[type="date"] {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    color: #17231f;
    background: #fff;
    border: 1px solid #cad3cf;
    border-radius: 10px;
    font: inherit;
    font-weight: 400;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.client-form input:focus {
    border-color: #47796c;
    outline: none;
    box-shadow: 0 0 0 4px rgba(71, 121, 108, .12);
}

.client-form small {
    color: #687772;
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.5;
}

.project-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.project-fieldset legend {
    margin-bottom: 12px;
    color: #1b2d29;
    font-weight: 700;
}

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

.check-card {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 52px;
    padding: 12px 14px;
    color: #263a34;
    background: #f6f8f7;
    border: 1px solid #dce3e0;
    border-radius: 10px;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.check-card:hover {
    background: #eef4f1;
    border-color: #a9c1ba;
    transform: translateY(-1px);
}

.check-card:has(input:checked) {
    background: #e7f0ec;
    border-color: #6e998d;
}

.check-card input {
    width: 17px;
    height: 17px;
    accent-color: #153a31;
}

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

.switch-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: #fff;
    border: 1px solid #dce3e0;
    border-radius: 10px;
    cursor: pointer;
}

.switch-option input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #153a31;
}

.switch-option span {
    display: grid;
    gap: 4px;
}

.switch-option strong {
    color: #1b2d29;
    font-size: .92rem;
}

.client-help-panel {
    padding: 32px;
    color: #f4f7f5;
    background:
        linear-gradient(
            145deg,
            #173b32,
            #0d2922
        );
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(13, 41, 34, .14);
}

.client-help-panel h2 {
    margin: 10px 0 14px;
    color: #fff;
    font-size: 1.55rem;
}

.client-help-panel p {
    margin: 0;
    color: rgba(255, 255, 255, .76);
    line-height: 1.7;
}

.client-help-panel ul {
    display: grid;
    gap: 10px;
    margin: 24px 0 0;
    padding: 20px 0 0 20px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .85);
    line-height: 1.5;
}

.client-list-panel {
    margin-top: 0;
}

.client-table td {
    vertical-align: middle;
}

.client-table td:first-child strong,
.table-secondary,
.table-tertiary {
    display: block;
}

.table-secondary {
    margin-top: 5px;
    color: #53655f;
    font-size: .86rem;
}

.table-tertiary {
    margin-top: 4px;
    color: #7c8985;
    font-size: .76rem;
}

.project-summary {
    display: block;
    max-width: 330px;
    color: #40524c;
    line-height: 1.55;
}

.status-pill.is-positive {
    color: #17533d;
    background: #e4f3eb;
}

.status-pill.is-muted {
    color: #68736f;
    background: #edf0ef;
}

.actions-column {
    text-align: right;
}

.row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.row-actions form {
    margin: 0;
}

.secondary-button,
.quiet-button,
.text-link {
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button,
.quiet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
}

.secondary-button {
    color: #153a31;
    background: #eef4f1;
    border: 1px solid #c7d8d2;
}

.quiet-button {
    color: #66564c;
    background: transparent;
    border: 1px solid #d8cec8;
}

.secondary-button:hover,
.quiet-button:hover {
    transform: translateY(-1px);
}

.text-link {
    color: #3f6d61;
    font-size: .84rem;
    font-weight: 700;
}

@media (max-width: 980px) {
    .client-layout {
        grid-template-columns: 1fr;
    }

    .client-help-panel {
        order: -1;
    }

    .client-table {
        min-width: 760px;
    }
}

@media (max-width: 680px) {
    .project-check-grid,
    .preference-grid {
        grid-template-columns: 1fr;
    }

    .client-help-panel {
        padding: 24px;
    }

    .client-form-panel,
    .client-list-panel {
        padding: 22px;
    }
}
/* ALTEA CLIENTES CRUD:FIN */

/* ALTEA NEWSLETTER PREVIEW:INICIO */
.newsletter-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

.newsletter-selector {
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 130px);
    overflow: hidden;
}

.newsletter-news-list {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 270px);
    margin-top: 22px;
    padding-right: 6px;
    overflow-y: auto;
}

.newsletter-news-item {
    display: grid;
    gap: 7px;
    padding: 15px;
    color: #243831;
    text-decoration: none;
    background: #f7f9f8;
    border: 1px solid #e1e7e4;
    border-radius: 10px;
    transition:
        border-color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.newsletter-news-item:hover {
    background: #edf4f1;
    border-color: #abc1ba;
    transform: translateY(-1px);
}

.newsletter-news-item.is-selected {
    background: #e5efeb;
    border-color: #618d80;
    box-shadow: inset 3px 0 0 #214c40;
}

.newsletter-news-item strong {
    font-size: .9rem;
    line-height: 1.4;
}

.newsletter-news-item small {
    color: #76847f;
}

.newsletter-news-type {
    color: #568075;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.newsletter-preview-column {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.newsletter-summary {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
}

.newsletter-summary h2 {
    margin: 8px 0 8px;
    color: #172822;
    font-size: 1.45rem;
}

.newsletter-summary p {
    max-width: 680px;
    margin: 0;
    color: #60706a;
    line-height: 1.55;
}

.newsletter-audience {
    display: grid;
    min-width: 150px;
    text-align: right;
}

.newsletter-audience strong {
    color: #183d33;
    font-size: 2.5rem;
    line-height: 1;
}

.newsletter-audience span {
    margin-top: 7px;
    color: #77847f;
    font-size: .75rem;
}

.project-scope-panel {
    padding-top: 24px;
    padding-bottom: 24px;
}

.scope-options {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.scope-options a {
    padding: 10px 14px;
    color: #385a51;
    text-decoration: none;
    background: #f3f7f5;
    border: 1px solid #d5e0dc;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

.scope-options a.is-selected {
    color: #fff;
    background: #183d33;
    border-color: #183d33;
}

.email-preview-panel {
    overflow: hidden;
}

.newsletter-email-frame {
    display: block;
    width: 100%;
    height: 880px;
    margin-top: 24px;
    background: #edf1ef;
    border: 1px solid #dce4e1;
    border-radius: 12px;
}

.newsletter-history {
    margin-top: 24px;
}

@media (max-width: 1050px) {
    .newsletter-workspace {
        grid-template-columns: 1fr;
    }

    .newsletter-selector {
        position: static;
        max-height: none;
    }

    .newsletter-news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 480px;
    }
}

@media (max-width: 680px) {
    .newsletter-news-list {
        grid-template-columns: 1fr;
        max-height: 420px;
    }

    .newsletter-summary {
        display: grid;
    }

    .newsletter-audience {
        text-align: left;
    }

    .newsletter-email-frame {
        height: 760px;
    }
}
/* ALTEA NEWSLETTER PREVIEW:FIN */

/* ALTEA-NEWSLETTER-CAMPAIGNS */
.campaign-safety {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: center;
    background: #15302b;
    color: #fff;
}

.campaign-safety h2,
.campaign-safety p {
    color: inherit;
}

.campaign-safety__states,
.campaign-scope-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.campaign-safety__states span,
.campaign-scope-list span {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.campaign-safety__states span {
    background: rgba(255, 255, 255, .12);
}

.campaign-scope-list span {
    background: #edf5f1;
    color: #15302b;
}

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

.campaign-news-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid #dce3df;
}

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

.campaign-news-card h3 {
    margin: 6px 0 14px;
    max-width: 780px;
}

.campaign-news-card__date {
    color: #718078;
    font-size: 12px;
}

.campaign-news-card__action {
    display: grid;
    gap: 12px;
    justify-items: end;
    text-align: right;
}

.campaign-warning {
    color: #9b5a36;
    font-weight: 700;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: .4;
}

.newsletter-campaign-console-link {
    margin-top: 24px;
}

@media (max-width: 760px) {
    .campaign-safety,
    .campaign-news-card {
        display: grid;
        grid-template-columns: 1fr;
    }

    .campaign-news-card__action {
        justify-items: stretch;
        text-align: left;
    }

    .campaign-news-card__action form,
    .campaign-news-card__action button {
        width: 100%;
    }
}
