* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 24%),
        linear-gradient(180deg, #eef3f8 0%, #e8edf4 100%);
    color: #132238;
}

body.admin-auth-page {
    display: grid;
    place-items: center;
    padding: 18px;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

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

.admin-shell {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.admin-page {
    display: grid;
    gap: 18px;
}

.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border-radius: 24px;
    margin-bottom: 18px;
}

.admin-subnav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    color: #304b69;
    font-weight: 800;
    background: #f7fafd;
    border: 1px solid #dde6f0;
}

.admin-subnav__item.is-active {
    color: #fff;
    background: linear-gradient(135deg, #0d4f9b, #28b463);
    border-color: transparent;
}

.admin-subnav__item.is-danger {
    color: #a12828;
    background: #fff6f6;
    border-color: #f2d2d2;
}

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

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

.admin-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.admin-content-grid--offers {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.85fr);
}

.metric-card {
    display: grid;
    gap: 8px;
    border-radius: 26px;
    padding: 22px;
}

.metric-card p,
.metric-card span {
    margin: 0;
}

.metric-card p {
    color: #61778d;
    font-weight: 700;
}

.metric-card strong {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: #10243f;
}

.metric-card span {
    color: #61778d;
}

.surface {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 22px 48px rgba(19, 34, 56, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 28px;
    margin-bottom: 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 24px 54px rgba(19, 34, 56, 0.1);
}

.admin-header h1,
.panel__header h2,
.form-section h3,
.empty-admin-state h3,
.offer-item h3 {
    margin: 0;
}

.admin-header h1 {
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.admin-header__lead {
    margin: 10px 0 0;
    max-width: 760px;
    color: #597089;
    line-height: 1.55;
}

.admin-header__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    background: #f4f8fc;
    border: 1px solid #d5e0ec;
    color: #1f3550;
    font-weight: 700;
    white-space: nowrap;
}

.admin-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-header__link--danger {
    background: #fff6f6;
    border-color: #f2d2d2;
    color: #a12828;
}

.admin-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    background: #f7fafd;
    border: 1px solid #d5e0ec;
    color: #27415f;
}

.admin-session-badge span {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6d8093;
}

.eyebrow {
    margin: 0 0 8px;
    color: #0d4f9b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
}

.notice {
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 14px;
    font-weight: 700;
}

.notice--success {
    background: rgba(34, 197, 94, 0.12);
    color: #11693a;
    border: 1px solid rgba(34, 197, 94, 0.16);
}

.notice--error {
    background: rgba(239, 68, 68, 0.1);
    color: #9f2130;
    border: 1px solid rgba(239, 68, 68, 0.16);
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(360px, 0.92fr);
    gap: 18px;
    align-items: start;
}

.admin-sidebar {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 18px;
}

.panel {
    border-radius: 28px;
    padding: 22px;
}

.panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.panel__hint {
    color: #6d8093;
    font-size: 0.9rem;
    text-align: right;
}

.admin-form {
    display: grid;
    gap: 18px;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #28415f;
    font-weight: 700;
}

.admin-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #0d4f9b;
}

.form-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: #f7fafd;
    border: 1px solid #e1e9f3;
}

.form-section h3 {
    font-size: 1.05rem;
}

.section-copy {
    margin: -6px 0 0;
    color: #607489;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    gap: 14px;
}

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

.form-field {
    display: grid;
    gap: 8px;
}

.form-field > span {
    font-weight: 700;
    color: #28415f;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #d7e3ef;
    border-radius: 16px;
    padding: 13px 14px;
    background: #fff;
    color: #132238;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-field textarea {
    resize: vertical;
    min-height: 126px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #5c9ef6;
    box-shadow: 0 0 0 4px rgba(92, 158, 246, 0.12);
}

.form-field small,
.map-card__error {
    color: #b42318;
    font-weight: 600;
}

.map-card {
    display: grid;
    gap: 14px;
}

.map-card__search-actions {
    display: grid;
    align-content: start;
    gap: 10px;
}

.map-card__search-help {
    color: #607489;
    line-height: 1.45;
}

.map-card__search-help.is-error {
    color: #b42318;
    font-weight: 700;
}

.admin-map {
    min-height: 360px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #dce6f1;
}

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

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 16px;
    font-weight: 800;
    cursor: pointer;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #0d4f9b, #28b463);
    box-shadow: 0 16px 26px rgba(13, 79, 155, 0.18);
}

.btn--ghost {
    color: #27415f;
    background: #f4f8fc;
    border: 1px solid #d5e0ec;
}

.btn:disabled,
.mini-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.public-card-preview {
    min-height: 280px;
}

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

.admin-listview {
    display: grid;
    gap: 12px;
}

.admin-list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    background: #f7fafd;
    border: 1px solid #e1e9f3;
}

.admin-list-row h3,
.admin-list-row p,
.admin-list-row small {
    margin: 0;
}

.admin-list-row p,
.admin-list-row small {
    color: #63778d;
}

.admin-list-row__meta {
    display: grid;
    gap: 8px;
    justify-items: end;
    text-align: right;
}

.future-section-list {
    display: grid;
    gap: 12px;
}

.future-section-item {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 20px;
    background: #f7fafd;
    border: 1px solid #e1e9f3;
}

.future-section-item h3,
.future-section-item p,
.future-section-item small {
    margin: 0;
}

.future-section-item p {
    color: #586f87;
    line-height: 1.5;
}

.future-section-item small {
    color: #0d4f9b;
    font-weight: 700;
}

.offer-item {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    background: #f7fafd;
    border: 1px solid #e1e9f3;
}

.offer-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.offer-item__top p,
.offer-item__meta,
.empty-admin-state p {
    margin: 0;
    color: #63778d;
}

.offer-item__meta,
.offer-item__links,
.offer-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offer-item__meta span,
.offer-item__links span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eaf2fb;
    color: #31516f;
    font-size: 0.86rem;
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: capitalize;
}

.status-pill--activo {
    background: rgba(34, 197, 94, 0.12);
    color: #11693a;
}

.status-pill--pausado {
    background: rgba(245, 158, 11, 0.12);
    color: #9a5b02;
}

.status-pill--archivado {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
}

.status-pill--running {
    background: rgba(59, 130, 246, 0.12);
    color: #1f5fae;
}

.status-pill--success {
    background: rgba(34, 197, 94, 0.12);
    color: #11693a;
}

.status-pill--error {
    background: rgba(239, 68, 68, 0.12);
    color: #a12828;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #d7e3ef;
    background: #fff;
    color: #27415f;
    font-weight: 700;
    cursor: pointer;
}

.mini-btn--link {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.mini-btn--danger {
    color: #a12828;
    background: #fff6f6;
    border-color: #f2d2d2;
}

.inline-action-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e2ebf3;
}

.admin-table th {
    color: #607489;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-table td {
    color: #1e3147;
    font-size: 0.95rem;
}

.admin-table__details-row td {
    background: #f7fafd;
}

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

.table-actions form {
    margin: 0;
}

.admin-log-output {
    margin: 16px 0 0;
    padding: 14px;
    border-radius: 18px;
    background: #0f172a;
    color: #d8e1f0;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 0.84rem;
    line-height: 1.45;
}

.admin-log-output--inline {
    margin-top: 10px;
}

.empty-admin-state {
    padding: 22px 18px;
    text-align: center;
    border-radius: 22px;
    background: #f7fafd;
    border: 1px dashed #ccd9e7;
}

.preview-card {
    border-radius: 26px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(207, 218, 230, 0.86);
    box-shadow: 0 22px 44px rgba(19, 34, 56, 0.12);
}

.preview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #d8e1eb;
}

.preview-card__company {
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.2;
}

.preview-card__distance {
    color: #6c7f93;
    font-size: 0.95rem;
    white-space: nowrap;
}

.preview-card__body {
    padding: 18px 20px 20px;
}

.preview-card__title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.45rem);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #0f2458;
    text-shadow: 0 1px 0 #ffffff;
}

.preview-card__location {
    margin: 8px 0 0;
    font-size: 1rem;
    color: #223249;
}

.preview-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 18px;
}

.preview-card__badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 10px;
    background: #dcecff;
    color: #203a56;
    font-size: 0.86rem;
    font-weight: 700;
}

.preview-card__description {
    margin: 0;
    color: #223249;
    line-height: 1.5;
}

.preview-card__divider {
    height: 1px;
    margin: 18px 0;
    background: #d8e1eb;
}

.preview-card__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.preview-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 0 14px;
    min-width: 0;
    border-radius: 14px;
    font-size: 0.98rem;
    font-weight: 900;
}

.preview-card__action span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-card__action svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex: 0 0 auto;
}

.preview-card__action--whatsapp {
    background: linear-gradient(135deg, #4aae5d, #6bcf79);
    color: #fff;
    box-shadow: 0 12px 20px rgba(74, 174, 93, 0.22);
}

.preview-card__action--email {
    background: linear-gradient(135deg, #3479bf, #4e93d7);
    color: #fff;
    box-shadow: 0 12px 20px rgba(52, 121, 191, 0.22);
}

.preview-card__action--instagram {
    background: #fff;
    color: #0f172a;
    border: 2px solid #0f172a;
}

.course-preview-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background: linear-gradient(135deg, #f4f7fb, #eef4f8);
    border: 1px solid rgba(207, 218, 230, 0.9);
    box-shadow: 0 22px 44px rgba(19, 34, 56, 0.12);
    min-height: 320px;
}

.course-preview-card__media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(241, 246, 252, 0.96) 0%, rgba(241, 246, 252, 0.84) 56%, rgba(241, 246, 252, 0.5) 100%),
        linear-gradient(135deg, #eef4fb, #dce8f5);
    background-size: cover;
    background-position: center;
}

.course-preview-card__body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    padding: 24px;
}

.course-preview-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.course-preview-card__brand {
    font-size: 1.02rem;
    font-weight: 900;
    color: #132238;
}

.course-preview-card__zone {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #485d73;
    font-size: 0.85rem;
    font-weight: 800;
}

.course-preview-card__title {
    margin: 0;
    max-width: 78%;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: #0f172a;
}

.course-preview-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.course-preview-card__pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #21374e;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(19, 34, 56, 0.08);
}

.course-preview-card__pill--mode {
    color: #0f7d7c;
    background: rgba(224, 249, 246, 0.95);
}

.course-preview-card__description {
    margin: 0;
    max-width: 78%;
    color: #334a62;
    line-height: 1.55;
    font-weight: 600;
}

.course-preview-card__actions {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.course-preview-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 14px;
    border-radius: 16px;
    font-weight: 900;
    text-align: center;
}

.course-preview-card__button--primary {
    color: #fff;
    background: linear-gradient(135deg, #2f7be8, #489ae9);
}

.course-preview-card__button--whatsapp {
    color: #fff;
    background: linear-gradient(135deg, #30b85a, #4dd36b);
}

.course-preview-card__button--ghost {
    grid-column: 1 / -1;
    color: #1f3550;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d5e0ec;
}

.leaflet-control-attribution {
    font-size: 0.75rem;
}

.admin-auth-shell {
    width: min(100%, 460px);
}

.admin-auth-card {
    border-radius: 28px;
    padding: 28px 24px;
}

.admin-auth-card h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.admin-auth-copy {
    margin: 12px 0 18px;
    color: #597089;
    line-height: 1.55;
}

.admin-auth-form {
    display: grid;
    gap: 14px;
}

.admin-auth-submit {
    width: 100%;
}

@media (max-width: 1180px) {
    .admin-sidebar {
        position: static;
    }

    .admin-content-grid,
    .admin-content-grid--offers,
    .admin-section-grid--metrics {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .admin-shell {
        width: min(100%, calc(100% - 18px));
        padding-top: 16px;
    }

    .admin-header,
    .panel {
        padding: 18px;
        border-radius: 24px;
    }

    .admin-header {
        flex-direction: column;
    }

    .admin-header__actions {
        justify-content: flex-start;
    }

    .admin-subnav {
        padding: 10px;
    }

    .admin-subnav__item {
        width: 100%;
        justify-content: flex-start;
    }

    .form-grid--two,
    .map-card__coords,
    .preview-card__actions {
        grid-template-columns: minmax(0, 1fr);
    }


    .admin-list-row {
        flex-direction: column;
    }

    .admin-list-row__meta {
        justify-items: start;
        text-align: left;
    }

    .preview-card__title {
        font-size: 1.9rem;
    }

    .course-preview-card__body {
        padding: 18px;
    }

    .course-preview-card__title,
    .course-preview-card__description {
        max-width: 100%;
    }

    .course-preview-card__actions {
        grid-template-columns: minmax(0, 1fr);
    }
}
