@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --sp-bg-main: linear-gradient(160deg, #0a1d38 0%, #16355f 44%, #2b5d9e 100%);
    --sp-glow-a: rgba(86, 131, 218, 0.38);
    --sp-glow-b: rgba(35, 197, 162, 0.24);
    --sp-surface: linear-gradient(160deg, rgba(250, 252, 255, 0.94) 0%, rgba(240, 246, 255, 0.9) 100%);
    --sp-text: #173252;
    --sp-muted: #496289;
    --sp-border: rgba(140, 176, 235, 0.6);
    --sp-primary: linear-gradient(135deg, #1b4c8d 0%, #2f6fb7 54%, #4a8ad5 100%);
    --sp-primary-flat: #2a63a8;
    --sp-shadow-soft: 0 14px 30px rgba(12, 30, 63, 0.18);
    --sp-shadow-strong: 0 22px 48px rgba(8, 18, 42, 0.35);
}

* {
    box-sizing: border-box;
}

body.sp-body {
    margin: 0;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--sp-text);
    background: var(--sp-bg-main);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

body.sp-body::before,
body.sp-body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(3px);
    z-index: 0;
}

body.sp-body::before {
    width: 440px;
    height: 440px;
    top: -120px;
    right: -110px;
    background: radial-gradient(circle, var(--sp-glow-a), transparent 72%);
}

body.sp-body::after {
    width: 500px;
    height: 500px;
    left: -160px;
    bottom: -180px;
    background: radial-gradient(circle, var(--sp-glow-b), transparent 72%);
}

.sp-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.sp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.sp-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--sp-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
    animation: spFloat 6s ease-in-out infinite;
}

.sp-card:nth-child(2) {
    animation-delay: 0.65s;
}

.sp-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sp-logo-main,
.sp-logo-side,
.sp-logo-bottom {
    display: block;
    width: auto;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #c7d7ef;
    border-radius: 13px;
    padding: 6px 8px;
    box-shadow: 0 9px 18px rgba(24, 52, 96, 0.2);
}

.sp-logo-main {
    max-width: min(100%, 310px);
    max-height: 106px;
}

.sp-logo-side {
    max-width: min(100%, 240px);
    max-height: 92px;
}

.sp-logo-row-dashboard {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sp-logo-main-dashboard {
    max-width: 170px !important;
    max-height: 56px !important;
    width: auto !important;
    height: auto !important;
    padding: 4px 6px;
}

.sp-logo-side-dashboard {
    max-width: 120px !important;
    max-height: 56px !important;
    width: auto !important;
    height: auto !important;
    padding: 4px 6px;
}

.sp-logo-bottom-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #d3e0f3;
    text-align: center;
}

.sp-logo-bottom {
    max-width: min(100%, 280px);
    max-height: 88px;
}

h1, h2, h3 {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
    margin-bottom: 8px;
}

h2 {
    font-size: clamp(1.1rem, 0.95rem + 0.55vw, 1.38rem);
    margin-bottom: 8px;
}

h3 {
    margin: 16px 0 4px;
}

.sp-muted {
    color: var(--sp-muted);
}

.sp-btn,
button {
    border: 1px solid transparent;
    border-radius: 13px;
    background: var(--sp-primary);
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(34, 92, 168, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.sp-btn:hover,
button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.sp-btn.ghost {
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    color: #1d4f8f;
    border-color: rgba(76, 121, 190, 0.38);
    box-shadow: 0 8px 16px rgba(21, 53, 100, 0.16);
}

.sp-btn.sp-btn-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    box-shadow: 0 8px 16px rgba(153, 27, 27, 0.28);
}

.sp-btn.sp-btn-danger:hover {
    filter: brightness(1.03);
}

.sp-btn.small {
    padding: 8px 12px;
    font-size: 13px;
}

.sp-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.sp-form {
    display: grid;
    gap: 10px;
}

.sp-form label {
    font-weight: 600;
    color: #27456e;
}

.sp-form input,
.sp-form textarea,
.sp-form select {
    width: 100%;
    border: 1px solid #bfd2ef;
    border-radius: 11px;
    padding: 10px 11px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.85);
    color: #1b3d63;
    box-shadow: inset 0 1px 2px rgba(17, 33, 59, 0.08);
}

.sp-form input:focus,
.sp-form textarea:focus,
.sp-form select:focus {
    outline: none;
    border-color: #6ea0e6;
    box-shadow: 0 0 0 3px rgba(70, 130, 222, 0.2);
}

.sp-check {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 14px;
    margin-top: 4px;
}

.sp-check input {
    width: auto;
    margin-top: 3px;
    accent-color: var(--sp-primary-flat);
}

.sp-alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
}

.sp-alert.ok {
    background: linear-gradient(180deg, #e8fff5 0%, #dbfaea 100%);
    color: #107859;
    border: 1px solid #87e5bd;
}

.sp-alert.error {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
    color: #9f1239;
    border: 1px solid #fda4af;
}

.sp-qr {
    width: 220px;
    max-width: 100%;
    border: 1px solid #cfddf2;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(26, 56, 106, 0.18);
}

.sp-url {
    word-break: break-word;
    font-size: 13px;
    color: #395b85;
}

.sp-link {
    display: inline-block;
    margin-top: 14px;
    color: #1e59a5;
    font-weight: 600;
}

.sp-conditions {
    border: 1px solid #c7d9f3;
    background: linear-gradient(180deg, rgba(250, 253, 255, 0.84), rgba(238, 246, 255, 0.84));
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
}

.sp-conditions ul,
.sp-card ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.sp-conditions li,
.sp-card li {
    margin-bottom: 4px;
}

.sp-dates {
    display: grid;
    gap: 8px;
}

.sp-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.sp-kpis article {
    background: linear-gradient(180deg, #f7fbff 0%, #edf4ff 100%);
    border: 1px solid #c9daf3;
    border-radius: 14px;
    padding: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sp-kpis strong {
    display: block;
    font-size: 25px;
    color: #1d518f;
}

.sp-kpis span {
    color: #4e6790;
    font-size: 13px;
}

.sp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sp-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.sp-chart-card {
    border: 1px solid #c8d8ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
    padding: 10px;
}

.sp-chart-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #2a4d79;
    font-weight: 700;
}

.sp-chart-box {
    position: relative;
    height: 220px;
    width: 100%;
}

.sp-charts canvas {
    width: 100% !important;
    height: 100% !important;
    border: 1px solid #c8d8ef;
    border-radius: 14px;
    background: #fff;
    padding: 6px;
}

.sp-table-wrap {
    overflow-x: auto;
    border: 1px solid #c8d7ee;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.sp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 950px;
}

.sp-table th,
.sp-table td {
    border-bottom: 1px solid #d8e4f4;
    text-align: left;
    padding: 10px;
    vertical-align: top;
    font-size: 14px;
}

.sp-table th {
    background: linear-gradient(180deg, #edf4ff 0%, #e2edff 100%);
    color: #244971;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.sp-inline {
    margin: 0;
}

.sp-calendar-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.sp-calendar-card {
    border: 1px solid #c8d8ef;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
}

.sp-calendar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sp-calendar-head h3 {
    margin: 0;
    font-size: 17px;
    color: #254972;
}

.sp-calendar-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.sp-cal-btn {
    border: 1px solid #b9d0ef;
    background: #0f4f43;
    color: #fff;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.sp-cal-btn.today {
    background: #125b4e;
}

.sp-calendar-view-switch {
    margin: 2px 0 8px;
    display: inline-flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d9e6f8;
}

.sp-calendar-view-switch span {
    font-size: 12px;
    font-weight: 700;
    text-transform: lowercase;
    padding: 6px 11px;
    background: #f5f9ff;
    color: #2b5a90;
    border-right: 1px solid #d9e6f8;
}

.sp-calendar-view-switch span:last-child {
    border-right: 0;
}

.sp-calendar-view-switch span.active {
    background: #0f4f43;
    color: #fff;
}

.sp-calendar-title {
    font-size: clamp(1.5rem, 1.1rem + 1vw, 2.1rem);
    font-weight: 800;
    color: #1f4f40;
    text-align: center;
    margin: 4px 0 12px;
}

.sp-calendar-days,
.sp-calendar-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.sp-calendar-weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1f4f40;
    text-transform: uppercase;
    padding: 8px 2px;
    border-top: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
}

.sp-day {
    min-height: 138px;
    border: 1px solid #edf2f7;
    border-radius: 0;
    background: #fff;
    padding: 8px 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-day.empty {
    background: #fff;
    min-height: 138px;
}

.sp-day.has-events {
    background: #f9fdfb;
}

.sp-day.is-other-month .sp-day-number {
    color: #b6c2cf;
}

.sp-day-number {
    font-size: 22px;
    font-weight: 800;
    color: #1f4f40;
    line-height: 1;
    align-self: flex-end;
}

.sp-day-events {
    display: grid;
    gap: 4px;
    overflow-y: auto;
    max-height: 92px;
}

.sp-event-item {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    padding: 4px 5px;
    border-radius: 7px;
    background: #dcecff;
    color: #1f4f86;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-event-item.estado-pendiente {
    background: #ffe4ea;
    color: #a1264d;
    border-left: 3px solid #ef476f;
}

.sp-event-item.estado-aprobada {
    background: #fff5dd;
    color: #9a6a03;
    border-left: 3px solid #ffd166;
}

.sp-event-item.estado-programada {
    background: #ddfbf2;
    color: #0f766e;
    border-left: 3px solid #06d6a0;
}

.sp-event-item.estado-realizada {
    background: #e2eeff;
    color: #1e4f92;
    border-left: 3px solid #118ab2;
}

.sp-event-empty {
    font-size: 11px;
    color: #8aa0bf;
}

.sp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

.sp-legend-item {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.sp-legend-item.pendiente {
    background: #ffe4ea;
    color: #a1264d;
    border-color: #f7a8bc;
}

.sp-legend-item.aprobada {
    background: #fff5dd;
    color: #9a6a03;
    border-color: #f6dc8c;
}

.sp-legend-item.programada {
    background: #ddfbf2;
    color: #0f766e;
    border-color: #8be7cc;
}

.sp-legend-item.realizada {
    background: #e2eeff;
    color: #1e4f92;
    border-color: #9fc2f2;
}

@keyframes spFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

@media (max-width: 760px) {
    .sp-container {
        padding: 14px;
    }

    .sp-grid {
        grid-template-columns: 1fr;
    }

    .sp-card {
        border-radius: 18px;
        padding: 16px;
    }

    .sp-chart-box { height: 210px; }

    .sp-logo-main {
        max-width: min(100%, 250px);
        max-height: 88px;
    }

    .sp-logo-side {
        max-width: min(100%, 190px);
        max-height: 74px;
    }

    .sp-logo-row-dashboard {
        justify-content: center;
    }

    .sp-day,
    .sp-day.empty {
        min-height: 100px;
    }

    .sp-calendar-title {
        font-size: 1.45rem;
    }

    .sp-day-number {
        font-size: 17px;
    }
}
