:root {
    --pink: #ff3366;
    --pink-dark: #ef2458;
    --pink-soft: #fff0f4;
    --pink-soft-2: #fff7f9;
    --border: #f2dfe5;
    --text: #292126;
    --muted: #81757a;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(173, 72, 102, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background: #fffafa;
    color: var(--text);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    display: block;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #eadde1;
    background: #ffffff;
    color: var(--text);
    border-radius: 12px;
    outline: none;
    transition: 0.2s ease;
}

input,
select {
    min-height: 46px;
    padding: 0 14px;
}

textarea {
    min-height: 92px;
    padding: 13px 14px;
    resize: vertical;
    line-height: 1.4;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #ff9ab3;
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.08);
}


/* =========================
   ESTRUTURA
========================= */

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.main {
    min-width: 0;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 30px 22px;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    z-index: 50;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 42px;
}

.logo-img {
    display: block;
    width: 205px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #4d4246;
    padding: 14px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 15px;
    text-align: left;
    transition: 0.2s ease;
}

.menu-item svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    color: var(--pink);
}

.menu-item:hover,
.menu-item.active {
    background: var(--pink-soft);
    color: var(--pink);
}

.menu-item.active {
    font-weight: 600;
}

.logout {
    margin-top: auto;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 13px;
    color: #4c4245;
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.logout:hover {
    background: var(--pink-soft);
    color: var(--pink);
}

.logout svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    color: var(--pink);
}


/* =========================
   VIEWS
========================= */

.view {
    display: none;
    min-height: 100vh;
}

.view.active-view {
    display: block;
}


/* =========================
   TOPBAR
========================= */

.topbar {
    height: 92px;
    padding: 0 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    font-size: 25px;
    margin-bottom: 5px;
}

.topbar p {
    color: var(--muted);
    font-size: 14px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), #ff6f8f);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
}


/* =========================
   DASHBOARD
========================= */

.content {
    padding: 36px 46px 50px;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

.title-row h2 {
    font-size: 23px;
}

.primary-button,
.publish-button {
    border: 0;
    background: linear-gradient(135deg, var(--pink), var(--pink-dark));
    color: white;
    padding: 14px 22px;
    border-radius: 13px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(255, 51, 102, 0.18);
    transition: 0.2s ease;
}

.primary-button:hover,
.publish-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(255, 51, 102, 0.24);
}


/* =========================
   CARDS DE RESUMO
========================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border: 1px solid #f5e6ea;
    border-radius: 22px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow);
    min-height: 150px;
}

.stat-icon {
    width: 55px;
    height: 55px;
    flex: 0 0 55px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--pink-soft);
    color: var(--pink);
}

.stat-icon svg {
    width: 25px;
    height: 25px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    margin-bottom: 7px;
}

.stat-card span {
    display: block;
    font-size: 14px;
    margin-bottom: 7px;
}

.stat-card small {
    color: #a29499;
    font-size: 12px;
}


/* =========================
   MINHAS FESTAS
========================= */

.parties-card {
    background: white;
    border: 1px solid #f4e6ea;
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.parties-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.parties-header h2 {
    font-size: 21px;
}

.search {
    border: 1px solid #eadde1;
    height: 46px;
    border-radius: 13px;
    width: 360px;
    max-width: 100%;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #95888d;
    background: #fff;
}

.search svg {
    width: 18px;
    height: 18px;
    color: var(--pink);
    flex: 0 0 18px;
}

.search input {
    border: 0;
    outline: 0;
    width: 100%;
    background: transparent;
    color: var(--text);
    min-height: auto;
    padding: 0;
    box-shadow: none;
}

.party-list {
    border-top: 1px solid #f1e3e7;
}

.party {
    display: grid;
    grid-template-columns:
        90px
        minmax(220px, 1.2fr)
        minmax(170px, 0.7fr)
        minmax(290px, 1fr);
    gap: 18px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f3e7ea;
}

.party:last-child {
    border-bottom: 0;
}

.party-cover {
    width: 76px;
    height: 76px;
    border-radius: 16px;
    overflow: hidden;
}

.placeholder-cover {
    display: grid;
    place-items: center;
    background:
        radial-gradient(
            circle at 30% 30%,
            rgba(255,255,255,.4) 0,
            transparent 28%
        ),
        linear-gradient(135deg, var(--pink), #ff6b8d);
    color: white;
    font-size: 23px;
    font-weight: 700;
}

.party-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.party-info p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px;
}

.party-confirmation strong {
    display: block;
    font-size: 16px;
    margin-bottom: 9px;
}

.progress {
    width: 150px;
    max-width: 100%;
    height: 6px;
    background: #eee6e8;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 7px;
}

.progress div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--pink), #ff7593);
}

.party-confirmation small {
    color: var(--muted);
}

.party-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.party-actions button {
    border: 1px solid #ffc2d1;
    background: white;
    color: var(--pink);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
}

.party-actions button:hover {
    background: var(--pink-soft);
}


/* =========================
   EDITOR
========================= */

#new-party-view {
    background: #fffafb;
}

.editor-topbar {
    min-height: 92px;
    padding: 18px 40px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.editor-title-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
}

.editor-title-wrap h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.editor-title-wrap p {
    color: var(--muted);
    font-size: 13px;
}

.back-button {
    width: 42px;
    height: 42px;
    border: 1px solid #f1dce2;
    background: white;
    color: var(--pink);
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.back-button svg {
    width: 19px;
    height: 19px;
}

.back-button:hover {
    background: var(--pink-soft);
}


/* =========================
   ESTRUTURA DO EDITOR
========================= */

.editor-content {
    max-width: 1450px;
    margin: 0 auto;
    padding: 30px 34px 50px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 355px;
    gap: 24px;
    align-items: start;
}

.editor-left {
    min-width: 0;
}

.editor-card {
    background: white;
    border: 1px solid #f4e5e9;
    border-radius: 20px;
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.editor-card-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 24px;
}

.editor-card-title h2 {
    font-size: 18px;
}

.section-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: var(--pink-soft);
    color: var(--pink);
    display: grid;
    place-items: center;
}

.section-icon svg {
    width: 19px;
    height: 19px;
}


/* =========================
   CAMPOS
========================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

.field {
    min-width: 0;
}

.field-name {
    grid-column: span 1;
}

.field-age {
    grid-column: span 1;
}

.field-full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #4b4045;
}

.field label span {
    font-weight: 400;
    color: #a09498;
}

.field small {
    display: block;
    margin-top: 6px;
    color: #a09498;
    font-size: 11px;
}

.counter {
    text-align: right;
}

.age-input-wrap {
    position: relative;
}

.age-input-wrap input {
    padding-right: 58px;
}

.age-input-wrap span {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9c8f94;
    font-size: 12px;
}


/* =========================
   MAPA
========================= */

.map-input-wrap {
    position: relative;
}

.map-input-wrap input {
    padding-left: 44px;
}

.map-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pink);
    z-index: 2;
}

.map-input-icon svg {
    width: 18px;
    height: 18px;
}


/* =========================
   ACOMPANHANTES
========================= */

.companions-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.guest-type-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.guest-type {
    min-height: 74px;
    border: 1px solid #eadde1;
    background: white;
    color: #564a4f;
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: 0.2s ease;
}

.guest-type span {
    display: block;
}

.guest-type small {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 400;
}

.guest-type.active,
.guest-type:hover {
    border-color: var(--pink);
    background: var(--pink-soft);
    color: var(--pink);
}


/* =========================
   PERSONALIZAÇÃO
========================= */

.customization-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-dot,
.color-add {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.color-dot {
    border: 2px solid white;
    outline: 1px solid #e8d9de;
    background: var(--color);
}

.color-dot.active-color {
    outline: 3px solid rgba(255, 51, 102, 0.22);
}

.color-add {
    position: relative;
    border: 1px dashed #d8c7cd;
    background: white;
    color: #85777c;
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
    overflow: hidden;
}

.color-add input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}


/* =========================
   CAPA
========================= */

.cover-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cover-thumb {
    width: 94px;
    height: 58px;
    border-radius: 12px;
    flex: 0 0 94px;
    overflow: hidden;
    position: relative;
    font-size: 18px;
}

.cover-thumb img,
.preview-cover-image img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-thumb.has-image span,
.preview-cover-image.has-image span {
    display: none;
}

.cover-thumb.has-image img,
.preview-cover-image.has-image img {
    display: block;
}

.secondary-button {
    border: 1px solid #ffc2d1;
    background: white;
    color: var(--pink);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s ease;
}

.secondary-button:hover {
    background: var(--pink-soft);
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.upload-button svg {
    width: 16px;
    height: 16px;
}

.delete-cover {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #f2cbd6;
    background: white;
    color: #d9577a;
    display: grid;
    place-items: center;
    transition: 0.2s ease;
}

.delete-cover:hover {
    background: #fff3f6;
}

.delete-cover svg {
    width: 17px;
    height: 17px;
}


/* =========================
   AÇÕES DO EDITOR
========================= */

.editor-bottom-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 4px 0 10px;
}

.cancel-button {
    border: 1px solid #e8d9dd;
    background: white;
    color: #61545a;
    padding: 13px 22px;
    border-radius: 12px;
    font-weight: 600;
}


/* =========================
   PRÉ-VISUALIZAÇÃO
========================= */

.preview-card {
    position: sticky;
    top: 116px;
    background: white;
    border: 1px solid #f4e5e9;
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.preview-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
}

.preview-heading h2 {
    font-size: 15px;
    margin-bottom: 4px;
}

.preview-heading p {
    font-size: 10px;
    color: var(--muted);
}

.phone {
    width: 255px;
    max-width: 100%;
    margin: 0 auto;
    border: 7px solid #292429;
    border-radius: 34px;
    background: #292429;
    padding: 4px;
    position: relative;
    box-shadow: 0 14px 35px rgba(50, 30, 38, 0.16);
}

.phone-notch {
    width: 76px;
    height: 16px;
    border-radius: 0 0 12px 12px;
    background: #292429;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.phone-screen {
    min-height: 490px;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
}

.preview-cover-image {
    width: 100%;
    height: 138px;
    border-radius: 0;
    position: relative;
    font-size: 28px;
    overflow: hidden;
}

.preview-body {
    padding: 16px 15px 19px;
    text-align: center;
}

.preview-label {
    display: inline-block;
    color: var(--pink);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 9px;
}

.preview-body h3 {
    color: var(--pink);
    font-family: Georgia, serif;
    font-size: 21px;
    line-height: 1.05;
    margin-bottom: 7px;
}

.preview-age {
    display: inline-block;
    border-radius: 999px;
    background: var(--pink-soft);
    color: var(--pink);
    padding: 4px 9px;
    font-size: 9px;
    font-weight: 700;
    margin-bottom: 11px;
}

.preview-body > p {
    font-size: 9px;
    line-height: 1.45;
    color: #75686d;
    margin: 0 auto 14px;
    max-width: 205px;
}

.preview-info-card {
    border: 1px solid #f0e0e5;
    border-radius: 14px;
    padding: 9px 11px;
    text-align: left;
}

.preview-info-row {
    display: grid;
    grid-template-columns: 29px 1fr;
    gap: 9px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #f5e9ec;
}

.preview-info-row:last-child {
    border-bottom: 0;
}

.preview-round-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pink-soft);
    color: var(--pink);
    display: grid;
    place-items: center;
}

.preview-round-icon svg {
    width: 14px;
    height: 14px;
}

.preview-info-row strong {
    display: block;
    color: #45383d;
    font-size: 9px;
    margin-bottom: 2px;
}

.preview-info-row span {
    display: block;
    font-size: 8px;
    color: #998d91;
    line-height: 1.35;
}


/* =========================
   RESPONSIVO
========================= */

@media (max-width: 1250px) {
    .editor-content {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .party {
        grid-template-columns: 80px 1fr 160px;
    }

    .party-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 1080px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .editor-content {
        grid-template-columns: 1fr;
    }

    .preview-card {
        position: static;
        width: 100%;
        max-width: 430px;
        margin: 0 auto;
    }

    .companions-grid,
    .customization-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .layout {
        display: block;
    }

    .sidebar {
        min-height: auto;
        height: auto;
        position: static;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .logo {
        margin-bottom: 18px;
    }

    .logo-img {
        width: 185px;
    }

    .menu {
        flex-direction: row;
        overflow-x: auto;
    }

    .menu-item {
        min-width: max-content;
    }

    .logout {
        display: none;
    }

    .topbar,
    .editor-topbar {
        height: auto;
        padding: 20px;
    }

    .profile span {
        display: none;
    }

    .content,
    .editor-content {
        padding: 22px;
    }

    .editor-topbar {
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-name,
    .field-age,
    .field-full {
        grid-column: auto;
    }

    .guest-type-options {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        display: block;
        padding: 18px;
        min-height: 125px;
    }

    .stat-icon {
        margin-bottom: 12px;
    }

    .parties-card,
    .editor-card {
        padding: 18px;
    }

    .parties-header {
        display: block;
    }

    .search {
        width: 100%;
        margin-top: 15px;
    }

    .party {
        grid-template-columns: 70px 1fr;
        gap: 14px;
    }

    .party-confirmation,
    .party-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .title-row {
        display: block;
    }

    .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .editor-topbar {
        display: block;
    }

    .editor-topbar > .publish-button {
        width: 100%;
        margin-top: 14px;
    }

    .editor-bottom-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cancel-button,
    .editor-bottom-actions .publish-button {
        width: 100%;
    }

    .phone {
        width: 245px;
    }
}
