/* v0.1.3.1 — preservação de formulário em erro */

.ticket-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.ticket-event-state {
    padding-top: 34px;
}

.ticket-create-type {
    margin-top: 0;
}

.ticket-type-create-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.8fr 110px 130px auto;
    gap: 12px;
    align-items: end;
}

.ticket-type-create-grid button {
    min-height: 46px;
}

.ticket-empty {
    margin-top: 18px;
}

.ticket-type-list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.ticket-type-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.ticket-type-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-soft);
}

.ticket-type-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ticket-type-title-row h2 {
    margin: 0;
    font-size: 23px;
}

.ticket-type-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ticket-type-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ticket-type-header-actions form {
    margin: 0;
}

.ticket-count-label {
    color: var(--muted);
    font-size: 12px;
}

.ticket-edit-details {
    border-bottom: 1px solid var(--border-soft);
}

.ticket-edit-details > summary,
.batch-create-details > summary,
.batch-edit-details > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.ticket-edit-details > summary::-webkit-details-marker,
.batch-create-details > summary::-webkit-details-marker,
.batch-edit-details > summary::-webkit-details-marker {
    display: none;
}

.ticket-edit-details > summary {
    padding: 13px 24px;
    color: #aab5c0;
    font-size: 12px;
    font-weight: 700;
}

.ticket-edit-details > summary:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .018);
}

.ticket-inline-form {
    display: grid;
    grid-template-columns: 1fr 1.8fr 100px 130px auto;
    gap: 12px;
    align-items: end;
    padding: 0 24px 20px;
}

.ticket-inline-form button {
    min-height: 46px;
}

.batch-section {
    padding: 22px 24px 24px;
}

.batch-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.batch-section-heading h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.batch-section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.batch-list {
    display: grid;
    gap: 10px;
}

.batch-card {
    padding: 15px;
    background: #0f1318;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
}

.batch-main {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) 130px 110px minmax(210px, 1fr);
    gap: 16px;
    align-items: center;
}

.batch-main h4 {
    margin: 8px 0 0;
    font-size: 16px;
}

.batch-price small,
.batch-quantity small,
.batch-window small {
    display: block;
    margin-bottom: 5px;
    color: #727f8c;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 800;
}

.batch-price strong,
.batch-quantity strong {
    font-size: 16px;
}

.batch-window span {
    display: block;
    color: #b8c2cc;
    font-size: 12px;
    line-height: 1.4;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #1d242c;
}

.batch-actions > form {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.batch-actions select {
    min-width: 120px;
    padding: 8px 10px;
    font-size: 12px;
}

.status-neutral {
    background: rgba(130, 145, 160, .08);
    color: #a0abb6;
    border: 1px solid rgba(130, 145, 160, .16);
}

.batch-edit-details {
    position: relative;
}

.batch-edit-details > summary {
    display: inline-flex;
    padding: 8px 11px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}

.batch-edit-details[open] > summary {
    border-color: #45515e;
}

.batch-edit-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: min(760px, calc(100vw - 70px));
    margin-top: 12px;
    padding: 15px;
    background: #151a20;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.batch-edit-form button {
    align-self: end;
    min-height: 46px;
}

.batch-empty-message {
    margin: 0 0 14px;
    padding: 13px 14px;
    color: var(--muted);
    background: #0f1318;
    border: 1px dashed var(--border);
    border-radius: 11px;
    font-size: 12px;
}

.batch-create-details {
    margin-top: 14px;
    border: 1px dashed #394451;
    border-radius: 12px;
}

.batch-create-details > summary {
    padding: 13px 15px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.batch-create-details[open] > summary {
    border-bottom: 1px solid var(--border-soft);
}

.batch-create-form {
    display: grid;
    grid-template-columns: 1.2fr 120px 120px 90px 1fr 1fr 130px auto;
    gap: 12px;
    align-items: end;
    padding: 15px;
}

.batch-create-form button {
    min-height: 46px;
}

/* Mostra visualmente qual formulário falhou e foi restaurado. */
.form-has-error {
    border-color: rgba(255, 107, 107, .52) !important;
    box-shadow: 0 0 0 1px rgba(255, 107, 107, .08);
}

details.form-has-error > summary {
    color: #ffabab;
}

@media (max-width: 1100px) {
    .ticket-type-create-grid,
    .ticket-inline-form {
        grid-template-columns: repeat(2, 1fr);
    }

    .ticket-type-create-grid button,
    .ticket-inline-form button {
        width: fit-content;
    }

    .batch-create-form {
        grid-template-columns: repeat(4, 1fr);
    }

    .batch-main {
        grid-template-columns: 1.3fr 120px 100px;
    }

    .batch-window {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .ticket-page-header,
    .ticket-type-header {
        flex-direction: column;
    }

    .ticket-event-state {
        padding-top: 0;
    }

    .ticket-type-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .ticket-type-create-grid,
    .ticket-inline-form,
    .batch-create-form,
    .batch-edit-form {
        grid-template-columns: 1fr;
    }

    .ticket-type-create-grid button,
    .ticket-inline-form button,
    .batch-create-form button,
    .batch-edit-form button {
        width: 100%;
    }

    .batch-main {
        grid-template-columns: 1fr 1fr;
    }

    .batch-main > div:first-child,
    .batch-window {
        grid-column: 1 / -1;
    }

    .batch-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-actions > form {
        width: 100%;
    }

    .batch-actions > form select {
        flex: 1;
    }

    .batch-edit-details > summary {
        width: 100%;
        justify-content: center;
    }

    .batch-edit-form {
        width: 100%;
    }
}
