/* MYAUBUILD — PREMIUM / OGH SOMBRIA */

:root {
    --p-bg: #0c0e12;
    --p-panel: #13161d;
    --p-card: #171b23;
    --p-border: rgba(255,255,255,.075);
    --p-text: #f5f7fb;
    --p-muted: #929baa;
    --p-accent: #7c6df2;
    --p-accent-soft: rgba(124,109,242,.13);
    --p-green: #65d99c;
    --p-yellow: #e6c167;
    --p-red: #ff858c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 72% 0%, rgba(124,109,242,.10), transparent 30%),
        var(--p-bg);
    color: var(--p-text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

.p-shell {
    width: min(1280px, calc(100% - 36px));
    margin: 0 auto;
}

.p-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--p-border);
}

.p-header__actions { display: flex; gap: 8px; }
.p-main { padding: 36px 0 70px; }

.p-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: var(--p-accent);
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.p-button--secondary {
    border: 1px solid var(--p-border);
    background: var(--p-card);
    color: #d8dce5;
}

.p-button--danger {
    background: rgba(255,133,140,.10);
    color: var(--p-red);
}

.p-button--small {
    min-height: 34px;
    padding: 0 11px;
    font-size: 11px;
}

.p-kicker {
    margin: 0 0 7px;
    color: #a99fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.p-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.04;
    letter-spacing: -.035em;
}

.p-subtitle {
    max-width: 760px;
    margin: 11px 0 0;
    color: var(--p-muted);
    font-size: 14px;
    line-height: 1.65;
}

.p-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

/* Banner compartilhado por todas as ferramentas de farm. */
.p-farm-hero-banner {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 280px;
    align-items: flex-end;
    padding: 32px 34px;
    border: 1px solid rgba(124,109,242,.22);
    border-radius: 20px;
    background-color: #10141b;
    background-image:
        linear-gradient(90deg, rgba(8,11,17,.96), rgba(8,11,17,.72) 62%, rgba(8,11,17,.54)),
        var(--farm-hero-bg, none);
    background-position: center;
    background-size: cover;
    box-shadow: 0 22px 55px rgba(0,0,0,.2);
}

.p-farm-hero-banner > div:first-child { max-width: 820px; }
.p-farm-hero-banner .p-title { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(36px, 5vw, 54px); }
.p-farm-hero-banner .p-subtitle { color: #aeb6c5; }
.p-farm-hero-banner .p-premium-chip { align-self: flex-start; }
.p-farm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.p-browiki-button {
    gap: 9px;
    border-color: rgba(119, 191, 255, .34);
    background: rgba(8, 18, 32, .78);
    color: #eef7ff;
    backdrop-filter: blur(8px);
}
.p-browiki-button:hover {
    border-color: rgba(119, 191, 255, .62);
    background: rgba(26, 68, 110, .78);
}
.p-browiki-button__icon {
    min-width: 30px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 7px;
    background: linear-gradient(145deg, #247cb8, #195387);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1;
}

@media (max-width: 720px) {
    .p-farm-hero-banner { min-height: 240px; padding: 24px 20px; }
    .p-farm-hero__actions .p-browiki-button { width: 100%; }
}

.p-premium-chip {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid rgba(124,109,242,.25);
    border-radius: 99px;
    background: var(--p-accent-soft);
    color: #b1a8ff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.p-grid { display: grid; gap: 14px; }
.p-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.p-grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

.p-stat,
.p-card {
    border: 1px solid var(--p-border);
    border-radius: 15px;
    background: var(--p-panel);
}

.p-stat { padding: 18px; }
.p-stat__label { color: var(--p-muted); font-size: 11px; }
.p-stat__value { margin-top: 8px; font-size: 25px; font-weight: 850; letter-spacing: -.03em; }
.p-stat__helper { margin-top: 6px; color: #697281; font-size: 10px; }

.p-section { margin-top: 18px; }

.p-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--p-border);
}

.p-card__title { margin: 0; font-size: 15px; }
.p-card__helper { margin-top: 5px; color: var(--p-muted); font-size: 11px; }
.p-card__body { padding: 20px; }

.p-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
}

.p-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--p-muted);
    font-size: 11px;
    font-weight: 700;
}

.p-field input,
.p-field select,
.p-field textarea {
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid var(--p-border);
    border-radius: 8px;
    background: #0f1218;
    color: #fff;
    outline: none;
    font: inherit;
}

.p-field textarea {
    min-height: 90px;
    padding: 10px 11px;
    resize: vertical;
}

.p-field input:focus,
.p-field select:focus,
.p-field textarea:focus {
    border-color: #7c6df2;
    box-shadow: 0 0 0 3px rgba(124,109,242,.10);
}

.p-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.p-alert {
    padding: 13px 15px;
    margin-bottom: 16px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.55;
}

.p-alert--success {
    border: 1px solid rgba(101,217,156,.18);
    background: rgba(101,217,156,.08);
    color: var(--p-green);
}

.p-alert--error {
    border: 1px solid rgba(255,133,140,.18);
    background: rgba(255,133,140,.08);
    color: #ff9da3;
}

.p-table-wrap { overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.p-table th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--p-border);
    color: var(--p-muted);
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.p-table td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(255,255,255,.045);
    vertical-align: middle;
    white-space: nowrap;
}

.p-table tr:last-child td { border-bottom: 0; }
.p-muted { color: var(--p-muted); }

.p-day-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
}

.p-day-total {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
    padding: 14px 20px;
    border-top: 1px solid var(--p-border);
    color: var(--p-muted);
    font-size: 11px;
}

.p-day-total strong { color: #fff; }

.p-chart {
    height: 220px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 18px 8px 8px;
    border-bottom: 1px solid var(--p-border);
}

.p-chart__col {
    min-width: 0;
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 7px;
}

.p-chart__bar-area {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.p-chart__bar {
    width: min(32px, 70%);
    min-height: 3px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(to top, #6253de, #8e82ff);
}

.p-chart__value,
.p-chart__label {
    color: #7d8695;
    text-align: center;
    font-size: 9px;
}

.p-history {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
}

.p-history-card {
    display: block;
    padding: 15px;
    border: 1px solid var(--p-border);
    border-radius: 12px;
    background: var(--p-card);
    color: inherit;
    text-decoration: none;
}

.p-history-card__date { font-size: 13px; font-weight: 800; }

.p-history-card__meta {
    display: grid;
    gap: 5px;
    margin-top: 11px;
    color: var(--p-muted);
    font-size: 10px;
}

.p-history-card__value {
    margin-top: 11px;
    color: #b2a9ff;
    font-size: 14px;
    font-weight: 850;
}

.p-empty {
    padding: 28px 18px;
    color: var(--p-muted);
    text-align: center;
    line-height: 1.6;
}

.p-dialog {
    width: min(470px, calc(100% - 28px));
    padding: 0;
    border: 1px solid var(--p-border);
    border-radius: 15px;
    background: var(--p-panel);
    color: #fff;
}

/*
 * Um dialog fechado nunca pode participar do fluxo da página. Alguns dos
 * estilos compartilhados dos farms usam grid/flex nos campos internos; sem
 * esta regra explícita, navegadores que recebem CSS legado em cache podem
 * acabar exibindo o conteúdo do formulário de "Criar dia" abaixo da
 * configuração de preços. O estado visual continua sendo controlado somente
 * por showModal()/close().
 */
.p-dialog:not([open]) {
    display: none !important;
}

.p-dialog::backdrop { background: rgba(0,0,0,.72); }
.p-dialog__head { padding: 18px 20px; border-bottom: 1px solid var(--p-border); }
.p-dialog__body { padding: 20px; }

.p-character-list { display: grid; gap: 9px; }

.p-character-item {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--p-border);
    border-radius: 11px;
    background: var(--p-card);
}

.p-character-name { font-size: 13px; font-weight: 800; }
.p-character-class { margin-top: 4px; color: var(--p-muted); font-size: 10px; }

@media (max-width: 1000px) {
    .p-grid--4, .p-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .p-history { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 650px) {
    .p-hero { display: block; }
    .p-premium-chip { margin-top: 14px; }
    .p-grid--4, .p-grid--2, .p-form-grid, .p-history { grid-template-columns: 1fr; }
}


/* ETAPA 11C.1 — BLOCOS DE DIA OGH */

.p-day-current {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--p-border);
    border-radius: 9px;
    background: #0f1218;
}

.p-day-current__date {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.p-day-current__weekday {
    color: var(--p-muted);
    font-size: 10px;
}

.p-day-status {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(101,217,156,.16);
    border-radius: 11px;
    background: rgba(101,217,156,.055);
}

.p-day-status > div {
    min-width: 0;
}

.p-day-status strong {
    display: block;
    color: #dce4e1;
    font-size: 11px;
}

.p-day-status span:not(.p-day-status__badge) {
    display: block;
    margin-top: 4px;
    color: var(--p-muted);
    font-size: 10px;
}

.p-day-status__badge {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    padding: 0 9px;
    border-radius: 99px;
    background: rgba(101,217,156,.10);
    color: var(--p-green);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.p-day-status--empty {
    border-color: rgba(230,193,103,.15);
    background: rgba(230,193,103,.05);
}

.p-day-status--empty strong {
    color: #e5d4ab;
}

.p-dialog-note {
    margin: 13px 0 0;
    color: var(--p-muted);
    font-size: 10px;
    line-height: 1.6;
}

.p-history-card.is-active {
    border-color: rgba(124,109,242,.38);
    background:
        linear-gradient(135deg, rgba(124,109,242,.10), rgba(124,109,242,.02)),
        var(--p-card);
    box-shadow: inset 0 0 0 1px rgba(124,109,242,.08);
}

button:disabled {
    cursor: not-allowed;
    opacity: .56;
}

@media (max-width: 650px) {
    .p-day-status {
        align-items: stretch;
        flex-direction: column;
    }

    .p-day-status form,
    .p-day-status .p-button {
        width: 100%;
    }
}


/* =========================================================
   ETAPA 11C.2 — CARDS DE FARM + CÁLCULO GERAL
   ========================================================= */

.p-ogh-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
    padding: 14px 16px;
    border: 1px solid var(--p-border);
    border-radius: 13px;
    background: rgba(19,22,29,.78);
}

.p-ogh-toolbar__status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p-ogh-toolbar__status span {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    border: 1px solid var(--p-border);
    border-radius: 99px;
    background: #0f1218;
    color: var(--p-muted);
    font-size: 10px;
}

.p-ogh-toolbar__status strong {
    color: #fff;
}

.p-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.p-section-title {
    margin: 0;
    font-size: 23px;
    letter-spacing: -.025em;
}

.p-section-copy {
    max-width: 720px;
    margin: 7px 0 0;
    color: var(--p-muted);
    font-size: 12px;
    line-height: 1.6;
}

.p-farm-cards {
    display: grid;
    gap: 18px;
}

.p-farm-card {
    overflow: hidden;
    border: 1px solid var(--p-border);
    border-radius: 16px;
    background: var(--p-panel);
    scroll-margin-top: 18px;
}

.p-farm-card:target {
    border-color: rgba(124,109,242,.42);
    box-shadow:
        0 0 0 3px rgba(124,109,242,.07),
        0 18px 50px rgba(0,0,0,.16);
}

.p-farm-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--p-border);
    background:
        linear-gradient(
            110deg,
            rgba(124,109,242,.075),
            transparent 40%
        );
}

.p-farm-card__identity {
    display: flex;
    align-items: center;
    gap: 13px;
}

.p-farm-card__number {
    min-width: 52px;
    height: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid rgba(124,109,242,.22);
    border-radius: 8px;
    background: rgba(124,109,242,.11);
    color: #b8b0ff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
}

.p-farm-card__date {
    margin: 0;
    font-size: 16px;
}

.p-farm-card__weekday {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 0;
    color: var(--p-muted);
    font-size: 10px;
}

.p-farm-card__today {
    display: inline-flex;
    min-height: 20px;
    align-items: center;
    padding: 0 7px;
    border-radius: 99px;
    background: rgba(101,217,156,.10);
    color: var(--p-green);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.p-farm-card__summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(90px, .7fr))
        minmax(170px, 1.2fr);
    gap: 1px;
    border-bottom: 1px solid var(--p-border);
    background: var(--p-border);
}

.p-farm-card__summary span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 16px;
    background: #11151c;
    color: var(--p-muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.p-farm-card__summary strong {
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.p-farm-card__summary .p-farm-card__summary-total {
    background: rgba(124,109,242,.06);
}

.p-farm-card__summary-total strong {
    color: #b8b0ff;
}

.p-table--farm-card th,
.p-table--farm-card td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.p-farm-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    padding: 13px 20px;
    border-top: 1px solid var(--p-border);
    background: #10131a;
    color: var(--p-muted);
    font-size: 10px;
}

.p-farm-card__footer strong {
    color: #fff;
}

.p-farm-card__footer-total {
    margin-left: auto;
}

.p-farm-card__footer-total strong {
    color: #b8b0ff;
    font-size: 12px;
}

.p-general-section {
    margin-top: 40px;
    padding-top: 4px;
}

.p-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 11px;
}

.p-stat--emphasis {
    border-color: rgba(124,109,242,.20);
    background:
        linear-gradient(
            140deg,
            rgba(124,109,242,.10),
            rgba(124,109,242,.025)
        ),
        var(--p-panel);
}

.p-empty--large {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.p-empty--large strong {
    color: #fff;
    font-size: 14px;
}

.p-empty--large span {
    max-width: 500px;
    margin-bottom: 6px;
}

.p-kicker--danger {
    color: var(--p-red);
}

.p-remove-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.p-remove-summary > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--p-border);
    border-radius: 9px;
    background: #0f1218;
}

.p-remove-summary span {
    color: var(--p-muted);
    font-size: 9px;
    text-transform: uppercase;
}

.p-remove-summary strong {
    color: #fff;
    font-size: 12px;
}

.p-danger-note {
    padding: 12px 13px;
    border: 1px solid rgba(255,133,140,.15);
    border-radius: 9px;
    background: rgba(255,133,140,.055);
    color: #d9a1a5;
    font-size: 10px;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .p-overview-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .p-farm-card__summary {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .p-farm-card__summary-total {
        grid-column: span 2;
    }
}

@media (max-width: 780px) {
    .p-ogh-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .p-ogh-toolbar .p-header__actions {
        width: 100%;
    }

    .p-ogh-toolbar .p-header__actions .p-button {
        flex: 1;
    }

    .p-farm-card__head {
        align-items: stretch;
        flex-direction: column;
    }

    .p-farm-card__head > .p-button {
        align-self: flex-start;
    }

    .p-farm-card__summary {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .p-farm-card__summary-total {
        grid-column: span 2;
    }

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

@media (max-width: 520px) {
    .p-farm-card__identity {
        align-items: flex-start;
    }

    .p-farm-card__summary,
    .p-overview-grid,
    .p-remove-summary {
        grid-template-columns: 1fr;
    }

    .p-farm-card__summary-total {
        grid-column: auto;
    }

    .p-farm-card__footer-total {
        width: 100%;
        margin-left: 0;
        padding-top: 5px;
        border-top: 1px solid var(--p-border);
    }
}


/* ETAPA 11C.2A — REORGANIZAÇÃO VISUAL */

.p-overall-card {
    margin-bottom: 24px;
    box-shadow: 0 14px 40px rgba(0,0,0,.14);
}

.p-overall-card .p-card__head {
    background: linear-gradient(120deg, rgba(124,109,242,.08), transparent 38%);
}

.p-overall-card .p-stat {
    background: #11151c;
}

.p-stat__value--money {
    font-size: 20px;
    line-height: 1.15;
}

.p-farm-cards {
    gap: 22px;
}

.p-farm-card {
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 16px 45px rgba(0,0,0,.18);
}

.p-farm-card__head {
    padding: 18px 22px;
}

.p-farm-card__summary {
    background: rgba(255,255,255,.04);
}

.p-farm-card__summary span {
    background: #11161d;
}

.p-farm-card__table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px 0;
}

.p-farm-card__table-title {
    margin: 0;
    font-size: 13px;
}

.p-farm-card__table-copy {
    margin: 5px 0 0;
    color: var(--p-muted);
    font-size: 10px;
    line-height: 1.5;
}

.p-farm-card .p-table-wrap {
    margin: 14px 20px 0;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    background: #0f1318;
}

.p-farm-card .p-table {
    min-width: 980px;
}

.p-farm-card .p-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #10141b;
}

.p-farm-card .p-table tbody tr:hover td {
    background: rgba(124,109,242,.035);
}

.p-farm-card .p-table td:first-child strong {
    display: block;
    font-size: 12px;
}

.p-farm-card .p-table td:last-child,
.p-farm-card .p-table th:last-child {
    text-align: right;
}

.p-farm-card .p-table td:last-child .p-button {
    min-width: 90px;
}

.p-farm-card__footer {
    padding: 14px 20px 16px;
}

@media (max-width: 780px) {
    .p-farm-card .p-table-wrap {
        margin: 12px 14px 0;
    }

    .p-farm-card__table-head,
    .p-farm-card__head,
    .p-farm-card__footer {
        padding-left: 14px;
        padding-right: 14px;
    }
}


/* ETAPA 11C.3 — FOCO EM USABILIDADE */

.p-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.p-ogh-toolbar {
    flex-wrap: wrap;
    padding: 16px;
    border-radius: 16px;
}

.p-day-card {
    overflow: hidden;
    border: 1px solid var(--p-border);
    border-radius: 18px;
    background: var(--p-panel);
    box-shadow: 0 16px 42px rgba(0,0,0,.16);
}

.p-day-card + .p-day-card {
    margin-top: 2px;
}

.p-day-card[open] {
    border-color: rgba(124,109,242,.22);
}

.p-day-card__summarybar {
    list-style: none;
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) minmax(280px, 1.2fr) minmax(180px, .8fr);
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    cursor: pointer;
    background: linear-gradient(115deg, rgba(124,109,242,.08), transparent 38%);
}

.p-day-card__summarybar::-webkit-details-marker {
    display: none;
}

.p-day-card__identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.p-day-card__number {
    min-width: 64px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid rgba(124,109,242,.22);
    border-radius: 10px;
    background: rgba(124,109,242,.12);
    color: #b9b1ff;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.p-day-card__date {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
}

.p-day-card__weekday {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 7px 0 0;
    color: var(--p-muted);
    font-size: 12px;
}

.p-day-card__today {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(101,217,156,.10);
    color: var(--p-green);
    font-size: 10px;
    font-weight: 800;
}

.p-day-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p-day-card__metrics span,
.p-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--p-border);
    border-radius: 999px;
    background: #10141b;
    color: #d3d8e3;
    font-size: 11px;
    white-space: nowrap;
}

.p-chip--done {
    border-color: rgba(101,217,156,.18);
    background: rgba(101,217,156,.08);
    color: var(--p-green);
}

.p-chip--ready {
    border-color: rgba(124,109,242,.22);
    background: rgba(124,109,242,.12);
    color: #bdb5ff;
}

.p-chip--wait {
    border-color: rgba(230,193,103,.20);
    background: rgba(230,193,103,.08);
    color: var(--p-yellow);
}

.p-chip--money {
    border-color: rgba(124,109,242,.20);
    background: rgba(124,109,242,.08);
    color: #bdb5ff;
    font-weight: 800;
}

.p-day-card__total {
    justify-self: end;
    text-align: right;
}

.p-day-card__total small {
    display: block;
    color: var(--p-muted);
    font-size: 11px;
}

.p-day-card__total strong {
    display: block;
    margin-top: 6px;
    color: #fff;
    font-size: 24px;
    line-height: 1.05;
    letter-spacing: -.03em;
}

.p-day-card__body {
    padding: 18px 22px 22px;
    border-top: 1px solid var(--p-border);
}

.p-day-card__body-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.p-day-card__body-title {
    margin: 0;
    font-size: 16px;
}

.p-day-card__body-copy {
    margin: 6px 0 0;
    color: var(--p-muted);
    font-size: 12px;
    line-height: 1.55;
}

.p-run-list {
    display: grid;
    gap: 12px;
}

.p-run-item {
    display: grid;
    grid-template-columns: minmax(160px, .9fr) minmax(260px, 1.5fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    background: #11151c;
}

.p-run-item.is-done {
    border-color: rgba(101,217,156,.10);
}

.p-run-item.is-ready {
    border-color: rgba(124,109,242,.12);
}

.p-run-item.is-wait {
    border-color: rgba(230,193,103,.11);
}

.p-run-item__title {
    font-size: 16px;
    font-weight: 800;
}

.p-run-item__subtitle {
    margin-top: 5px;
    color: var(--p-muted);
    font-size: 12px;
}

.p-run-item__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p-run-item__action {
    display: flex;
    justify-content: flex-end;
}

.p-run-item__action .p-button {
    min-width: 112px;
}

.p-day-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--p-border);
    color: var(--p-muted);
    font-size: 12px;
}

.p-day-card__footer strong {
    color: #fff;
}

.p-day-card__footer-total {
    margin-left: auto;
}

.p-day-card__footer-total strong {
    color: #bdb5ff;
    font-size: 14px;
}

@media (max-width: 1100px) {
    .p-day-card__summarybar {
        grid-template-columns: 1fr;
    }

    .p-day-card__total {
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 820px) {
    .p-run-item {
        grid-template-columns: 1fr;
    }

    .p-run-item__action {
        justify-content: flex-start;
    }

    .p-day-card__body-head {
        flex-direction: column;
    }

    .p-day-card__footer-total {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .p-day-card__body,
    .p-day-card__summarybar {
        padding-left: 14px;
        padding-right: 14px;
    }

    .p-day-card__date,
    .p-day-card__total strong {
        font-size: 20px;
    }
}

/* =========================================================
   ETAPA 11C.4 — BACKGROUND DO CARD + VENDA FECHADA
   ========================================================= */

:root {
    --ogh-day-card-bg: url('/assets/images/ogh/day-card-bg.webp');
}

.p-day-card {
    position: relative;
    isolation: isolate;
    background: #11151c;
}

.p-day-card {
    background-image:
        linear-gradient(
            rgba(12, 14, 18, 0.86),
            rgba(12, 14, 18, 0.94)
        ),
        var(--ogh-day-card-bg);

    background-size: cover;
    background-position: left top;
    background-repeat: no-repeat;
}

.p-day-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(124,109,242,.035),
        rgba(10,13,18,.18)
    );
    pointer-events: none;
}

.p-day-card__summarybar,
.p-day-card__body {
    background: rgba(13,17,23,.76);
    backdrop-filter: blur(2px);
}

.p-day-card[open] .p-day-card__body {
    background: rgba(13,17,23,.86);
}

.p-day-card.is-sold {
    border-color: rgba(101,217,156,.24);
}

.p-day-card.is-sold::after {
    background: linear-gradient(
        180deg,
        rgba(101,217,156,.035),
        rgba(10,13,18,.22)
    );
}

.p-day-card__sold-badge,
.p-day-card__open-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
}

.p-day-card__sold-badge {
    border: 1px solid rgba(101,217,156,.18);
    background: rgba(101,217,156,.10);
    color: var(--p-green);
}

.p-day-card__open-badge {
    border: 1px solid rgba(124,109,242,.22);
    background: rgba(124,109,242,.10);
    color: #bdb5ff;
}

.p-day-card__total span {
    display: block;
    margin-top: 6px;
    color: var(--p-muted);
    font-size: 10px;
}

.p-day-card__total.is-realized strong {
    color: var(--p-green);
}

.p-day-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.p-button--sale {
    background: rgba(101,217,156,.12);
    color: var(--p-green);
    border: 1px solid rgba(101,217,156,.20);
}

.p-button--sale:hover {
    background: rgba(101,217,156,.18);
}

.p-chip--sold {
    border-color: rgba(101,217,156,.18);
    background: rgba(101,217,156,.09);
    color: var(--p-green);
}

.p-run-item.is-locked {
    opacity: .82;
}

.p-sale-lock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(101,217,156,.17);
    border-radius: 13px;
    background: rgba(101,217,156,.065);
}

.p-sale-lock > div {
    display: grid;
    gap: 4px;
}

.p-sale-lock__label {
    color: var(--p-green);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.p-sale-lock strong {
    color: #fff;
    font-size: 13px;
}

.p-sale-lock small {
    color: var(--p-muted);
    font-size: 10px;
    line-height: 1.5;
}

.p-sale-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 9px;
}

.p-sale-preview-grid--three {
    grid-template-columns: repeat(3, minmax(0,1fr));
}

.p-sale-preview-grid--four {
    grid-template-columns: repeat(4, minmax(0,1fr));
}

.p-sale-preview-grid > div {
    display: grid;
    gap: 6px;
    padding: 13px;
    border: 1px solid var(--p-border);
    border-radius: 10px;
    background: #0f1319;
}

.p-sale-preview-grid span {
    color: var(--p-muted);
    font-size: 10px;
}

.p-sale-preview-grid strong {
    color: #fff;
    font-size: 17px;
}

.p-sale-preview-grid > div:last-child strong {
    color: var(--p-green);
}

.p-sale-info {
    margin-top: 14px;
    padding: 12px 13px;
    border: 1px solid rgba(124,109,242,.15);
    border-radius: 10px;
    background: rgba(124,109,242,.06);
    color: #a8afbd;
    font-size: 10px;
    line-height: 1.65;
}

.p-stat--sold {
    border-color: rgba(101,217,156,.16);
    background: linear-gradient(
        145deg,
        rgba(101,217,156,.07),
        rgba(17,21,28,.96)
    );
}

@media (max-width: 820px) {
    .p-sale-lock {
        align-items: stretch;
        flex-direction: column;
    }

    .p-day-card__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .p-sale-preview-grid,
    .p-sale-preview-grid--three,
    .p-sale-preview-grid--four {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   ETAPA 11C.4.1 — PREÇO EDITÁVEL POR DIA / REABERTURA
   ========================================================= */

.p-day-price-helper {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    align-items: center;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--p-border);
    border-radius: 10px;
    background: #0f1218;
}

.p-day-price-helper span {
    color: var(--p-muted);
    font-size: 10px;
}

.p-day-price-helper strong {
    color: #fff;
    font-size: 13px;
}

.p-day-price-helper .p-button {
    grid-column: 1 / -1;
    justify-self: start;
}

.p-reopen-options {
    display: grid;
    gap: 9px;
}

.p-reopen-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: flex-start;
    padding: 13px;
    border: 1px solid var(--p-border);
    border-radius: 11px;
    background: #10141b;
    cursor: pointer;
}

.p-reopen-option:has(input:checked) {
    border-color: rgba(124,109,242,.36);
    background: rgba(124,109,242,.08);
}

.p-reopen-option input {
    margin-top: 3px;
    accent-color: var(--p-accent);
}

.p-reopen-option strong {
    display: block;
    color: #fff;
    font-size: 12px;
}

.p-reopen-option small {
    display: block;
    margin-top: 5px;
    color: var(--p-muted);
    font-size: 10px;
    line-height: 1.5;
}

.p-reopen-sale-reference {
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    color: var(--p-muted);
    font-size: 10px;
}

.p-reopen-sale-reference strong {
    color: #fff;
}

/* =========================================
   BACKGROUND VISÍVEL DOS CARDS OGH
   ========================================= */

.p-day-card {
    background: #13161d;
}


/* Imagem aplicada diretamente no cabeçalho */
.p-day-card__summarybar {
    background-image:
        linear-gradient(
            90deg,
            rgba(12, 14, 18, 0.68) 0%,
            rgba(12, 14, 18, 0.78) 55%,
            rgba(12, 14, 18, 0.88) 100%
        ),
        var(--ogh-day-card-bg);

    background-position:
        left top,
        left top;

    background-size:
        cover,
        cover;

    background-repeat:
        no-repeat,
        no-repeat;
}

/* =========================================
   OGH — AJUSTE DE LEGIBILIDADE
   ========================================= */

/* Texto padrão */
body {
    font-size: 16px;
}

/* Texto explicativo abaixo do título */
.p-subtitle,
.p-section-copy {
    font-size: 15px;
    line-height: 1.6;
}

/* Labels superiores */
.p-kicker {
    font-size: 12px;
}

/* Status do topo */
.p-ogh-toolbar__status span {
    font-size: 14px;
}

/* Título dos cards */
.p-day-card__date {
    font-size: 26px;
}

/* Quinta / Sexta etc */
.p-day-card__weekday {
    font-size: 14px;
}

/* DIA 1 / DIA 2 */
.p-day-card__number {
    font-size: 14px;
}

/* Informações do card:
   personagens / MS / Extra / MC */
.p-day-card__metrics span,
.p-chip {
    font-size: 14px;
}

/* Ganho do dia */
.p-day-card__total small {
    font-size: 14px;
}

.p-day-card__total strong {
    font-size: 27px;
}

/* Títulos internos */
.p-day-card__body-title {
    font-size: 18px;
}

/* Descrição interna */
.p-day-card__body-copy {
    font-size: 14px;
}

/* Nome do personagem */
.p-run-item__title {
    font-size: 16px;
}

/* Classe / informação secundária */
.p-run-item__subtitle {
    font-size: 14px;
}

/* Botões */
.p-button {
    font-size: 14px;
}

.p-button--small {
    font-size: 14px;
}

/* Cards de cálculo geral */
.p-stat__label {
    font-size: 14px;
}

.p-stat__value {
    font-size: 28px;
}

.p-stat__helper {
    font-size: 11px;
}

/* Rodapé do dia */
.p-day-card__footer {
    font-size: 14px;
}
/* =========================================
   OGH — MODAIS MAIS LEGÍVEIS
   ========================================= */

.p-dialog {
    width: min(580px, calc(100% - 32px));
}


/* Cabeçalho */
.p-dialog__head {
    padding: 22px 24px 20px;
}

.p-dialog__head .p-kicker {
    font-size: 13px;
    line-height: 1.3;
}

.p-dialog__head .p-card__title {
    margin-top: 8px;
    font-size: 20px;
    line-height: 1.35;
}


/* Conteúdo */
.p-dialog__body {
    padding: 24px;
}


/* Campos dos quadrinhos:
   BLOCO / DATA / RUNS / TOTAL */
.p-remove-summary span {
    font-size: 11px;
    line-height: 1.4;
}

.p-remove-summary strong {
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.4;
}


/* Caixas da confirmação */
.p-remove-summary > div {
    min-height: 66px;
    padding: 14px 15px;
}


/* Texto de aviso */
.p-danger-note {
    padding: 15px 16px;

    font-size: 13px;
    line-height: 1.6;
}


/* Labels dos formulários */
.p-dialog .p-field label {
    font-size: 13px;
}


/* Inputs */
.p-dialog .p-field input,
.p-dialog .p-field select,
.p-dialog .p-field textarea {
    min-height: 46px;

    font-size: 14px;
}


/* Textos auxiliares */
.p-dialog-note,
.p-dialog .p-subtitle,
.p-dialog .p-card__helper {
    font-size: 13px;
    line-height: 1.6;
}


/* Botões */
.p-dialog .p-button {
    min-height: 44px;

    padding-left: 18px;
    padding-right: 18px;

    font-size: 14px;
}


/* Mais espaço entre conteúdo e botões */
.p-dialog .p-form-actions {
    margin-top: 20px;
    gap: 10px;
}

/* Shared contract: creation of a farm day (personal and legacy farms). */
.p-dialog--farm-day {
    width: min(680px, calc(100% - 32px));
}

.p-dialog--farm-day .p-dialog__head {
    padding-bottom: 18px;
}

.p-dialog--farm-day .p-dialog__body {
    padding-top: 22px;
}

.farm-day-dialog__body > form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.farm-day-dialog__body .p-field,
.farm-day-dialog__price-grid .p-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.farm-day-dialog__body .p-field > span,
.farm-day-dialog__body .p-field > label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 19px;
    color: var(--p-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.farm-day-dialog__body .p-field > span img,
.farm-day-dialog__body .p-field > label img {
    flex: 0 0 auto;
}

.farm-day-dialog__date {
    width: min(100%, 280px);
}

.farm-day-dialog__price-grid {
    display: grid;
    /* O contrato de um dia de farm tem no máximo três itens principais.
       Mantemos três colunas estáveis no desktop para os farms pessoais e
       legados terem exatamente o mesmo espaçamento visual. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 14px;
    margin: 0;
    width: 100%;
}

.farm-day-dialog__body .p-dialog-note {
    margin: 0;
}

.farm-day-dialog__body .p-form-actions {
    margin-top: 0;
}

/* =========================================================
   MODAIS — ALTURA VISÍVEL E ROLAGEM SEGURA
   ========================================================= */

.p-dialog[open] {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    overscroll-behavior: contain;
}

.p-dialog[open] > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
    overflow: hidden;
}

.p-dialog__head {
    flex: 0 0 auto;
}

.p-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

html.has-open-dialog,
body.has-open-dialog {
    overflow: hidden;
    overscroll-behavior: none;
}

body.has-open-dialog {
    padding-right: var(--dialog-scrollbar-gap, 0);
}

@media (max-width: 650px) {
    .p-dialog[open] {
        width: calc(100vw - 16px) !important;
        max-width: none;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        margin: auto;
        border-radius: 12px;
    }

    .p-dialog__head {
        padding: 18px 18px 16px;
    }

    .p-dialog__body {
        padding: 18px;
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .p-dialog--farm-day .p-dialog__body {
        padding-top: 18px;
    }

    .farm-day-dialog__date {
        width: 100%;
    }

    .farm-day-dialog__price-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .p-dialog .p-form-actions {
        flex-wrap: wrap;
    }

    .p-dialog .p-form-actions .p-button {
        flex: 1 1 132px;
    }
}

/* =========================================================
   DAY CARD — GIF / MONSTRO DO FARM
   ========================================================= */

.p-day-card__summary-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.p-day-card__visual {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(124, 109, 242, 0.18);
    background: rgba(10, 13, 19, 0.46);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 8px 24px rgba(0,0,0,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.p-day-card__visual img {
    display: block;
    max-width: 92%;
    max-height: 92%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.p-day-card__header-copy {
    min-width: 0;
}

.p-day-card__header-copy .p-day-card__title {
    margin-top: 2px;
}

@media (max-width: 780px) {
    .p-day-card__summary-main {
        align-items: flex-start;
    }

    .p-day-card__visual {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 12px;
    }
}
