* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

:root {
    --azul-francia: #243b6b;
    --azul-suave: #eef4ff;
    --rojo-francia: #d94a5c;
    --rojo-hover: #c7384b;
    --crema: #fff8ee;
    --crema-oscuro: #f4e4cf;
    --texto-principal: #263238;
    --texto-secundario: #667085;
    --borde-suave: #eadfd4;
    --sombra-suave: 0 12px 30px rgba(36, 59, 107, 0.10);
    --sombra-card: 0 10px 22px rgba(36, 59, 107, 0.14);
}

/* FONDO GENERAL */

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(217, 74, 92, 0.10), transparent 26%),
        radial-gradient(circle at 88% 12%, rgba(36, 59, 107, 0.09), transparent 28%),
        radial-gradient(circle at 50% 95%, rgba(255, 211, 226, 0.18), transparent 32%),
        linear-gradient(135deg, #fff8ee 0%, #faf3ec 42%, #eef4ff 100%);
    color: var(--texto-principal);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        radial-gradient(rgba(36, 59, 107, 0.055) 1px, transparent 1px),
        linear-gradient(135deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
    background-size: 24px 24px, 100% 100%;
    opacity: 0.65;
}

body::after {
    content: "🗼";
    position: fixed;
    right: 3vw;
    bottom: -2vh;
    font-size: clamp(110px, 16vw, 230px);
    color: rgba(36, 59, 107, 0.045);
    line-height: 1;
    pointer-events: none;
    z-index: -1;
    transform: rotate(-6deg);
    filter: grayscale(1);
}

/* CONTENEDOR GENERAL */

.app-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 28px clamp(18px, 3vw, 54px) 42px;
}

/* HEADER */

.header {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94) 0%, rgba(255,244,247,0.92) 55%, rgba(238,244,255,0.92) 100%);
    padding: 26px 30px;
    border-radius: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    box-shadow: var(--sombra-suave);
    border: 1px solid rgba(234, 223, 212, 0.9);
    backdrop-filter: blur(8px);
}

.header::before {
    content: "MT";
    position: absolute;
    right: 28px;
    top: 18px;
    font-size: 12px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(36, 59, 107, 0.22);
    font-weight: 900;
}

.header::after {
    content: "♡";
    position: absolute;
    right: -25px;
    bottom: -65px;
    font-size: 190px;
    color: rgba(217, 74, 92, 0.07);
    line-height: 1;
}

.header > div,
.header button {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: clamp(25px, 2vw, 36px);
    margin-bottom: 7px;
    color: var(--azul-francia);
    letter-spacing: -0.5px;
}

.header h1::before {
    content: "";
}

.header p {
    color: var(--texto-secundario);
    font-size: 15px;
}

/* BOTONES */

.btn-primary {
    background: linear-gradient(135deg, var(--rojo-francia), #e87585);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 13px 22px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(217, 74, 92, 0.25);
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--rojo-hover), #dd6475);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f4ef;
    color: var(--azul-francia);
    border: 1px solid #eadfd4;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 700;
}

.btn-secondary:hover {
    background: #f1e8dc;
}

/* RESUMEN GENERAL */

.resumen-general {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.resumen-card {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 12px 16px;
    min-height: 76px;
    box-shadow: var(--sombra-suave);
    border: 1px solid rgba(234, 223, 212, 0.9);
    position: relative;
    overflow: hidden;
}

.resumen-card::after {
    content: "";
    position: absolute;
    width: 46px;
    height: 46px;
    right: -14px;
    bottom: -14px;
    border-radius: 50%;
    background: rgba(217, 74, 92, 0.08);
}

.resumen-card span {
    display: block;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
}

.resumen-card strong {
    font-size: 26px;
    color: var(--azul-francia);
    line-height: 1;
}

.resumen-barra {
    width: 100%;
    height: 7px;
    background: rgba(36, 59, 107, 0.08);
    border-radius: 999px;
    margin-top: 10px;
    overflow: hidden;
}

.resumen-progreso {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.progreso-total {
    background: var(--azul-francia);
}

.progreso-pendiente {
    background: #d94a5c;
}

.progreso-proceso {
    background: #e0a93f;
}

.progreso-terminado {
    background: #5fac75;
}

.resumen-total {
    border-left: 6px solid var(--azul-francia);
}

.resumen-pendiente {
    border-left: 6px solid #d94a5c;
}

.resumen-proceso {
    border-left: 6px solid #e0a93f;
}

.resumen-terminado {
    border-left: 6px solid #5fac75;
}

/* BARRA DE HERRAMIENTAS */

.barra-herramientas {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 26px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    box-shadow: var(--sombra-suave);
    border: 1px solid rgba(234, 223, 212, 0.9);
}

.buscador {
    width: 100%;
    border: 1px solid #eadfd4;
    border-radius: 999px;
    padding: 14px 18px;
    font-size: 15px;
    outline: none;
    background: #fffdf9;
    color: var(--texto-principal);
}

.buscador::placeholder {
    color: #a08f82;
}

.buscador:focus {
    border-color: rgba(217, 74, 92, 0.55);
    box-shadow: 0 0 0 4px rgba(217, 74, 92, 0.10);
}

.vista-toggle,
.pwa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.vista-btn,
.btn-install,
.btn-notify {
    border: 1px solid #eadfd4;
    background: #fffdf9;
    color: var(--azul-francia);
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    transition: 0.2s ease;
    white-space: nowrap;
}

.vista-btn:hover,
.btn-notify:hover {
    background: #fff4f7;
}

.vista-btn.active {
    background: var(--azul-francia);
    color: #ffffff;
    border-color: var(--azul-francia);
}

.btn-install {
    background: var(--azul-francia);
    color: #ffffff;
    border-color: var(--azul-francia);
}

.btn-notify {
    background: #fff4f7;
    color: var(--rojo-francia);
}

.btn-install:hover,
.btn-notify:hover {
    transform: translateY(-1px);
}

/* SECCIONES */

.secciones-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(310px, 1fr));
    gap: 24px;
    align-items: start;
}

.seccion-box {
    background: rgba(255,255,255,0.88);
    border-radius: 28px;
    padding: 22px;
    box-shadow: var(--sombra-suave);
    min-height: 520px;
    border: 1px solid rgba(234, 223, 212, 0.95);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.seccion-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(217,74,92,0.08), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,0.42), transparent 55%);
    pointer-events: none;
}

.seccion-header,
.lista-tareas {
    position: relative;
    z-index: 1;
}

.seccion-header {
    background: #fff8ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-radius: 20px;
    padding: 15px 16px;
    border: 1px solid #eadfd4;
}

.seccion-header h2 {
    font-size: 22px;
    color: var(--azul-francia);
    font-weight: 900;
}

.icono-seccion {
    margin-right: 7px;
}

.lista-tareas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 22px 18px;
    align-items: start;
    padding-top: 8px;
}

/* POST-IT */

.tarea-card {
    position: relative;
    min-height: 195px;
    border-radius: 18px;
    padding: 32px 16px 15px;
    box-shadow: var(--sombra-card);
    border: 1px solid rgba(255,255,255,0.8);
    transition: 0.2s ease;
    overflow: visible;
}

.tarea-card::before {
    content: "🗼";
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%) rotate(-6deg);
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 2px solid rgba(36, 59, 107, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 5px 12px rgba(36, 59, 107, 0.20);
    z-index: 4;
}

.tarea-card::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    width: 54px;
    height: 18px;
    transform: translateX(-50%) rotate(-3deg);
    background: rgba(255,255,255,0.42);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(36, 59, 107, 0.08);
    z-index: 2;
}

.seccion-cotizaciones .tarea-card {
    background: #fff3a6;
}

.seccion-contenido .tarea-card {
    background: #cfeeff;
}

.seccion-activaciones .tarea-card {
    background: #ffd4e2;
}

.seccion-operativo .tarea-card {
    background: #d8f8cd;
}

.tarea-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(36, 59, 107, 0.18);
}

.tarea-card > * {
    position: relative;
    z-index: 3;
}

.tarea-header {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 11px;
}

.tarea-header h4 {
    font-size: 17px;
    line-height: 1.25;
    color: #24313f;
    font-weight: 900;
}

.tarea-card p {
    font-size: 14px;
    color: #3f3f46;
    margin-bottom: 12px;
    line-height: 1.4;
}

.badges-tarea {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* ESTADOS */

.estado-badge {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: 0.2s ease;
}

.estado-badge:hover {
    transform: scale(1.04);
}

.estado-badge-pendiente {
    background: #fff1f2;
    color: #b42337;
    border: 1px solid #ffb8c2;
}

.estado-badge-en_proceso {
    background: #fff7d6;
    color: #9a6700;
    border: 1px solid #f4d36b;
}

.estado-badge-terminado {
    background: #e8f8ee;
    color: #24764b;
    border: 1px solid #9dddb4;
}

/* FECHAS */

.tarea-fechas {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 11px;
    margin-bottom: 13px;
}

.fecha-tarea,
.fecha-creacion {
    padding: 7px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
}

.fecha-normal,
.fecha-proxima {
    background: rgba(255,255,255,0.68);
    color: #475467;
    border: 1px solid rgba(255,255,255,0.7);
}

.fecha-manana {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.fecha-hoy {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.fecha-vencida {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.fecha-creacion {
    background: rgba(255,255,255,0.48);
    color: #667085;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.65);
}

/* ACCIONES */

.acciones {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.btn-completar,
.btn-edit,
.btn-ocultar {
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 900;
    transition: 0.2s ease;
}

.btn-completar {
    background: #e8f8ee;
    color: #24764b;
    border: 1px solid #9dddb4;
}

.btn-edit {
    background: rgba(255,255,255,0.78);
    color: var(--azul-francia);
    border: 1px solid rgba(36, 59, 107, 0.14);
}

.btn-ocultar {
    background: var(--azul-francia);
    color: white;
    border: none;
}

.btn-completar:hover,
.btn-edit:hover,
.btn-ocultar:hover {
    transform: translateY(-1px);
}

.btn-edit:hover {
    background: #ffffff;
}

.btn-ocultar:hover {
    background: #1a2d55;
}

.vacio {
    color: #667085;
    font-size: 14px;
    background: #fff8ee;
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    grid-column: 1 / -1;
    border: 1px dashed #d8c8b8;
    font-weight: 800;
}

/* VISTA LISTA */

.vista-lista {
    grid-template-columns: 1fr;
}

.vista-lista .seccion-box {
    min-height: auto;
}

.vista-lista .lista-tareas {
    grid-template-columns: 1fr;
}

.vista-lista .tarea-card {
    min-height: auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 24px 16px 16px;
}

.vista-lista .tarea-card::before {
    left: 24px;
    top: -12px;
    transform: rotate(-6deg);
}

.vista-lista .tarea-card::after {
    left: 24px;
    top: 5px;
    transform: rotate(-3deg);
}

.vista-lista .tarea-header,
.vista-lista .tarea-fechas,
.vista-lista .acciones {
    margin: 0;
}

/* MODAL */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(36, 59, 107, 0.45);
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 999;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 28px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(36, 59, 107, 0.30);
    border: 1px solid #eadfd4;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--azul-francia);
}

.modal-header h2::before {
    content: "♡ ";
    color: var(--rojo-francia);
}

.modal-header button {
    background: #fff4f7;
    border: none;
    color: var(--azul-francia);
    font-size: 24px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.modal-header button:hover {
    background: #ffe6ee;
}

form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

form label {
    font-size: 14px;
    font-weight: 900;
    color: var(--azul-francia);
}

form input,
form textarea,
form select {
    width: 100%;
    border: 1px solid #eadfd4;
    border-radius: 16px;
    padding: 12px;
    font-size: 15px;
    outline: none;
    background: #fffdf9;
}

form input:focus,
form textarea:focus,
form select:focus {
    border-color: rgba(217, 74, 92, 0.55);
    box-shadow: 0 0 0 4px rgba(217, 74, 92, 0.10);
}

form textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

/* CELEBRACIÓN DE METAS */

.celebracion-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(255, 248, 238, 0.92), rgba(36, 59, 107, 0.52));
    backdrop-filter: blur(7px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.35s ease;
    padding: 20px;
}

.celebracion-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.celebracion-card {
    width: min(92vw, 470px);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,244,247,0.96));
    border: 1px solid rgba(234, 223, 212, 0.95);
    border-radius: 30px;
    padding: 34px 28px;
    text-align: center;
    box-shadow: 0 28px 80px rgba(36, 59, 107, 0.28);
    transform: translateY(20px) scale(0.94);
    transition: 0.35s ease;
    position: relative;
    overflow: hidden;
}

.celebracion-overlay.show .celebracion-card {
    transform: translateY(0) scale(1);
}

.celebracion-card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -80px;
    top: -90px;
    border-radius: 50%;
    background: rgba(217, 74, 92, 0.10);
}

.celebracion-card::after {
    content: "Paris • Douceur • Charme";
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    font-size: 10px;
    letter-spacing: 1.2px;
    color: rgba(36, 59, 107, 0.24);
    font-weight: 900;
    white-space: nowrap;
}

.celebracion-icono {
    font-size: 64px;
    margin-bottom: 10px;
    animation: celebracionPop 1.2s ease infinite alternate;
}

.celebracion-card h2 {
    color: var(--azul-francia);
    font-size: 29px;
    margin-bottom: 8px;
}

.celebracion-card h3 {
    color: var(--rojo-francia);
    font-size: 20px;
    margin-bottom: 12px;
}

.celebracion-card p {
    color: #667085;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 22px;
}

.celebracion-card button {
    background: linear-gradient(135deg, var(--rojo-francia), #e87585);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(217, 74, 92, 0.25);
    transition: 0.2s ease;
}

.celebracion-card button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--rojo-hover), #dd6475);
}

.celebracion-particula {
    position: fixed;
    top: -40px;
    z-index: 10000;
    pointer-events: none;
    animation-name: caerCelebracion;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes caerCelebracion {
    0% {
        transform: translateY(-40px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes celebracionPop {
    from {
        transform: scale(1) rotate(-4deg);
    }

    to {
        transform: scale(1.12) rotate(4deg);
    }
}

/* RESPONSIVE */

@media (min-width: 1500px) {
    .secciones-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1499px) {
    .secciones-grid {
        grid-template-columns: repeat(2, minmax(320px, 1fr));
    }
}

@media (max-width: 1100px) {
    .app-container {
        padding: 20px;
    }

    .barra-herramientas {
        grid-template-columns: 1fr;
    }

    .vista-toggle,
    .pwa-actions {
        justify-content: flex-start;
    }

    .resumen-general {
        grid-template-columns: repeat(2, 1fr);
    }

    .secciones-grid {
        grid-template-columns: 1fr;
    }

    .seccion-box {
        min-height: auto;
    }

    .lista-tareas {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .vista-lista .tarea-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .app-container {
        width: 100%;
        padding: 14px;
    }

    .header {
        padding: 20px;
        border-radius: 22px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header h1 {
        font-size: 25px;
    }

    .header::before {
        display: none;
    }

    .btn-primary {
        width: 100%;
    }

    .resumen-general {
        grid-template-columns: 1fr;
    }

    .resumen-card {
        min-height: 68px;
        padding: 11px 15px;
    }

    .resumen-card strong {
        font-size: 24px;
    }

    .barra-herramientas {
        padding: 14px;
    }

    .vista-toggle,
    .pwa-actions {
        width: 100%;
    }

    .vista-btn,
    .btn-install,
    .btn-notify {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .seccion-box {
        padding: 15px;
        border-radius: 22px;
    }

    .seccion-header {
        align-items: flex-start;
    }

    .lista-tareas {
        grid-template-columns: 1fr;
        padding-top: 12px;
    }

    .tarea-card {
        padding-top: 34px;
    }

    .acciones {
        justify-content: flex-start;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
    }

    .celebracion-card {
        padding: 30px 22px;
        border-radius: 26px;
    }

    .celebracion-icono {
        font-size: 54px;
    }

    .celebracion-card h2 {
        font-size: 24px;
    }

    .celebracion-card h3 {
        font-size: 18px;
    }
}

@media (max-width: 390px) {
    .header h1 {
        font-size: 22px;
    }

    .resumen-card strong {
        font-size: 23px;
    }

    .seccion-header h2 {
        font-size: 19px;
    }

    .btn-completar,
    .btn-edit,
    .btn-ocultar {
        font-size: 11px;
        padding: 7px 10px;
    }
}