#campaignDetailSection.campaign-detail {
    display: grid;
    gap: 22px;
    margin-top: 0;
    padding: 22px;
    overflow: visible;
    background: #fff;
}

#campaignDetailSection.campaign-detail.hidden {
    display: none;
}

.campaign-detail__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 !important;
    padding: 18px 20px;
    border: 1px solid #e8e3f4;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff 0%, #faf8ff 100%);
}

.campaign-detail__header > div:first-child {
    min-width: 0;
}

#campaignDetailTitle {
    margin: 0;
    color: #172033;
    font-size: 25px;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

#campaignDetailMeta {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1edf9;
    color: #5b4776;
    font-size: 12px;
    font-weight: 650;
}

.campaign-detail__header .dashboard-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.campaign-detail__header .btn-secondary,
.campaign-detail__header .btn-primary {
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.campaign-detail__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 !important;
}

.campaign-detail__stats .stat-card {
    position: relative;
    min-height: 126px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid #e8ecf2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.campaign-detail__stats .stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #64748b;
}

.campaign-detail__stats .stat-card:nth-child(2)::before {
    background: #16a34a;
}

.campaign-detail__stats .stat-card:nth-child(3)::before {
    background: #d97706;
}

.campaign-detail__stats .stat-card:nth-child(4)::before {
    background: #7c3aed;
}

.campaign-detail__stats .stat-card__label {
    margin: 0 0 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
}

.campaign-detail__stats .stat-card strong {
    display: block;
    margin-bottom: 6px;
    color: #172033;
    font-size: 29px;
    line-height: 1;
}

.campaign-detail__stats .stat-card small {
    color: #667085;
    font-size: 11px;
}

.campaign-detail__filters,
.campaign-detail__records {
    border: 1px solid #e5e9f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.04);
}

.campaign-detail__filters {
    padding: 17px 18px 18px;
}

.campaign-detail__filters-heading,
.campaign-detail__records-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.campaign-detail__filters-heading {
    margin-bottom: 14px;
}

.campaign-detail__filters-heading span,
.campaign-detail__records-heading span {
    display: block;
    margin-bottom: 3px;
    color: #6d28d9;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.campaign-detail__filters-heading h3,
.campaign-detail__records-heading h3 {
    margin: 0;
    color: #172033;
    font-size: 17px;
    line-height: 1.25;
}

.campaign-detail__filters-heading small,
.campaign-detail__records-heading small {
    color: #7c8799;
    font-size: 11px;
}

.campaign-detail__filter-grid {
    display: grid !important;
    grid-template-columns: minmax(280px, 2fr) minmax(170px, 1fr) minmax(170px, 1fr);
    gap: 12px;
    align-items: end;
}

.campaign-detail__filter-grid .field-group {
    min-width: 0;
}

.campaign-detail__filter-grid label {
    margin-bottom: 1px;
    color: #536079;
    font-size: 11px;
    font-weight: 750;
}

.campaign-detail__filter-grid input,
.campaign-detail__filter-grid select {
    height: 40px;
    border-color: #d8dee8;
    border-radius: 10px;
    background-color: #fff;
}

.campaign-detail__filter-grid input:focus,
.campaign-detail__filter-grid select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.campaign-detail__records {
    overflow: hidden;
}

.campaign-detail__records-heading {
    padding: 17px 18px 14px;
    border-bottom: 1px solid #edf0f4;
}

.campaign-detail__table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 0 !important;
    border-radius: 0 !important;
}

.campaign-detail__table-wrap .records-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: separate;
    border-spacing: 0;
}

.campaign-detail__table-wrap .records-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 13px;
    border-bottom: 1px solid #e2e7ee;
    background: #f8fafc;
    color: #536079;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.campaign-detail__table-wrap .records-table td {
    padding: 13px;
    border-bottom: 1px solid #eef1f5;
    color: #344054;
    font-size: 12px;
    vertical-align: middle;
}

.campaign-detail__table-wrap .records-table tbody tr {
    transition: background 0.15s ease;
}

.campaign-detail__table-wrap .records-table tbody tr:hover {
    background: #fbfaff;
}

.campaign-detail__table-wrap .records-table tbody tr:last-child td {
    border-bottom: 0;
}

.campaign-detail__table-wrap .records-table th:first-child,
.campaign-detail__table-wrap .records-table td:first-child {
    min-width: 165px;
    color: #172033;
    font-weight: 750;
}

.campaign-detail__table-wrap .records-table th:nth-child(2),
.campaign-detail__table-wrap .records-table td:nth-child(2) {
    min-width: 135px;
    white-space: nowrap;
}

.campaign-detail__table-wrap .records-table th:nth-child(3),
.campaign-detail__table-wrap .records-table td:nth-child(3) {
    min-width: 95px;
}

.campaign-detail__table-wrap .records-table th:nth-child(7),
.campaign-detail__table-wrap .records-table td:nth-child(7) {
    min-width: 155px;
}

.campaign-detail__table-wrap .records-table th:last-child,
.campaign-detail__table-wrap .records-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    width: 210px;
    min-width: 210px;
    background: #fff;
    box-shadow: -8px 0 14px -14px rgba(15, 23, 42, 0.65);
}

.campaign-detail__table-wrap .records-table th:last-child {
    z-index: 4;
    background: #f8fafc;
}

.campaign-detail__table-wrap .records-table tbody tr:hover td:last-child {
    background: #fbfaff;
}

.campaign-detail__table-wrap .table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

.campaign-detail__table-wrap .btn-sm {
    min-width: 54px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
}

.campaign-detail__table-wrap [data-action="delete-registro"] {
    border-color: #fecdd3;
    background: #fff7f8;
    color: #a1122a;
}

.campaign-detail__table-wrap [data-action="delete-registro"]:hover {
    background: #ffe8ec;
}

.campaign-detail__table-wrap .status-chip {
    padding: 5px 8px;
    font-size: 10px;
}

@media (max-width: 900px) {
    .campaign-detail__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .campaign-detail__header .dashboard-hero__actions {
        width: 100%;
        justify-content: flex-start;
    }

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

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

    .campaign-detail__filter-grid .field-group:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    #campaignDetailSection.campaign-detail {
        gap: 16px;
        padding: 14px;
    }

    .campaign-detail__stats,
    .campaign-detail__filter-grid {
        grid-template-columns: 1fr;
    }

    .campaign-detail__filter-grid .field-group:first-child {
        grid-column: auto;
    }

    .campaign-detail__filters-heading,
    .campaign-detail__records-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .campaign-detail__header .btn-secondary,
    .campaign-detail__header .btn-primary {
        flex: 1;
    }
}
