:root {
    --sp-primary: #601028;
    --sp-primary-soft: #7e1b3a;
    --sp-secondary: #a62346;
    --sp-bg: #f6f3ef;
    --sp-surface: #ffffff;
    --sp-text: #1f2937;
    --sp-muted: #6b7280;
    --sp-border: #e8dee2;
    --sp-shadow-sm: 0 3px 14px rgba(76, 18, 38, 0.07);
    --sp-transition: all 0.22s ease;
}

* {
    font-family:
        "Montserrat",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    background: var(--sp-bg);
}

.sp-page {
    width: min(1320px, calc(100% - 2rem));
    margin: 1.75rem auto 2.5rem;
}

.sp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--sp-primary) url("/images/fondo_rojo.png") center / cover
        no-repeat;
    border: none;
    padding: 1.1rem 2rem;
    color: #fff;
    box-shadow: none;
}

.sp-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
}

.sp-hero-escudo {
    width: 52px;
    height: auto;
    opacity: 0.92;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.sp-hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sp-hero-title {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sp-hero-subtitle {
    margin: 0.15rem auto 0;
    max-width: 740px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.sp-hero-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 200px;
}

.sp-hero-stat {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.sp-hero-stat span {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.9;
}

.sp-hero-stat strong {
    margin-top: 0.1rem;
    font-size: 1.15rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sp-alert {
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0.8rem 0.95rem;
    font-weight: 600;
}

.sp-alert-success {
    background: #ebf9f2;
    color: #0f5132;
    border-color: #9ddfba;
}

.sp-alert-warning {
    background: #fff7df;
    color: #8a6100;
    border-color: #f1dc99;
}

.sp-alert-danger {
    background: #fdf0f2;
    color: #7a2236;
    border-color: #efc2cf;
}

.sp-alert-info {
    background: #edf6ff;
    color: #1d4f8f;
    border-color: #bfd9fb;
}

.sp-shell {
    margin-top: 1.2rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    box-shadow: var(--sp-shadow-sm);
    padding: 1.5rem;
}

.sp-back-link {
    display: inline-flex;
    margin-bottom: 1rem;
}

.sp-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Accordion */
.sp-accordion {
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    overflow: hidden;
}

.sp-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.1rem;
    background: #faf7f8;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: var(--sp-transition);
}

.sp-accordion-header::-webkit-details-marker {
    display: none;
}

.sp-accordion-header:hover {
    background: #f5eef0;
}

.sp-accordion[open] > .sp-accordion-header {
    border-bottom: 1px solid var(--sp-border);
}

.sp-accordion-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    color: #5c1e33;
}

.sp-accordion-count {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid #d7c4cb;
    background: #fff;
    color: #651c32;
}

.sp-accordion-body {
    padding: 1rem 1.1rem;
}

/* Grid & Cards */
.sp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.sp-card {
    border-radius: 6px;
    border: 1px solid #eadde1;
    background: #fff;
    box-shadow: 0 4px 15px rgba(83, 26, 44, 0.08);
    padding: 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    transition: var(--sp-transition);
}

.sp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 22px rgba(77, 20, 37, 0.14);
    border-color: #d5a9b8;
}

.sp-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
}

.sp-badge-type,
.sp-badge-period {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.sp-badge-type {
    color: #651f35;
    background: #f7e6ec;
}

.sp-badge-period {
    color: #0a5a54;
    background: #dbf3f1;
}

.sp-card-title {
    margin: 0.85rem 0;
    font-size: 1.05rem;
    color: var(--sp-text);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.sp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.95rem;
}

.sp-card-meta span {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    background: #fff;
    border: 1px solid #eadadf;
    color: #5f6369;
    font-size: 0.83rem;
    font-weight: 700;
}

.sp-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.sp-btn {
    border-radius: 10px;
    padding: 0.5rem 0.74rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--sp-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sp-btn-primary {
    border: 1px solid #8a1f40;
    background: #8a1f40;
    color: #fff;
}

.sp-btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(166, 35, 70, 0.25);
}

.sp-btn-secondary {
    border: 1px solid #d7c7ce;
    background: #fff;
    color: #5b2435;
}

.sp-btn-secondary:hover {
    background: #fff4f7;
    color: #5b2435;
}

.sp-empty {
    border: 1px dashed #ddc8cf;
    border-radius: 14px;
    background: #fffafc;
    color: #744254;
    text-align: center;
    padding: 1.35rem 1rem;
}

.sp-empty i {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.sp-empty p {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .sp-page {
        width: calc(100% - 1rem);
        margin-top: 1rem;
    }

    .sp-hero {
        padding: 0.7rem 0.75rem;
    }

    .sp-hero-escudo {
        width: 36px;
    }

    .sp-hero-subtitle {
        font-size: 0.78rem;
    }

    .sp-hero-stats {
        max-width: 180px;
    }

    .sp-shell {
        padding: 1rem;
    }

    .sp-accordion-body {
        padding: 0.75rem;
    }
}
