* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef2f7;
    --text: #172033;
    --muted: #667085;
    --line: #d9e1ec;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16803c;
    --success-soft: #e8f7ed;
    --warning: #b7791f;
    --warning-soft: #fff6dd;
    --danger: #b42318;
    --danger-soft: #fde8e5;
    --info-soft: #e8f0ff;
    --radius: 8px;
    --shadow: 0 14px 40px rgba(21, 32, 55, .12);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: 0;
}

h1 {
    font-size: 1.7rem;
}

h2 {
    font-size: 1.2rem;
}

h3 {
    font-size: 1rem;
}

p {
    margin: .65rem 0;
}

code {
    border-radius: 5px;
    background: var(--surface-soft);
    padding: .14rem .32rem;
}

label {
    display: grid;
    gap: .35rem;
    color: #344054;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
    padding: .72rem .8rem;
}

textarea {
    min-height: 84px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 0;
    border-radius: 7px;
    padding: .68rem 1rem;
    color: var(--text);
    background: var(--surface-soft);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
button:hover {
    text-decoration: none;
    filter: brightness(.98);
}

.button.primary,
button.primary {
    color: #fff;
    background: var(--primary);
}

.button.secondary {
    color: var(--primary-dark);
    background: var(--info-soft);
}

.button.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.button.full {
    width: 100%;
}

.button.small {
    min-height: 34px;
    padding: .45rem .65rem;
    font-size: .9rem;
}

.alert {
    border-radius: var(--radius);
    margin: .85rem 0;
    padding: .8rem .9rem;
    font-weight: 700;
}

.alert.success {
    color: var(--success);
    background: var(--success-soft);
}

.alert.error {
    color: var(--danger);
    background: var(--danger-soft);
}

.muted {
    color: var(--muted);
    font-size: .92rem;
}

.eyebrow {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.25rem;
    background:
        linear-gradient(120deg, rgba(37, 99, 235, .12), rgba(22, 128, 60, .08)),
        var(--bg);
}

.login-panel {
    display: grid;
    width: min(920px, 100%);
    grid-template-columns: 1.1fr .9fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-copy {
    display: grid;
    align-content: center;
    min-height: 460px;
    padding: clamp(2rem, 6vw, 4rem);
    color: #fff;
    background:
        linear-gradient(rgba(15, 23, 42, .66), rgba(15, 23, 42, .55)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='700' viewBox='0 0 900 700'%3E%3Crect width='900' height='700' fill='%232563eb'/%3E%3Cpath d='M0 520C160 410 300 620 470 488C620 374 730 230 900 320V700H0Z' fill='%2316803c' fill-opacity='.75'/%3E%3Cpath d='M90 160H810V260H90zM170 310H730V380H170zM240 430H660V490H240z' fill='%23ffffff' fill-opacity='.18'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}

.login-copy .eyebrow,
.login-copy p {
    color: rgba(255, 255, 255, .82);
}

.login-copy h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.form-card {
    display: grid;
    align-content: center;
    gap: 1rem;
    padding: clamp(1.25rem, 4vw, 2.2rem);
}

.setup-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.setup-card {
    width: min(680px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: clamp(1.2rem, 4vw, 2rem);
    box-shadow: var(--shadow);
}

.config-list {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: .5rem 1rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
}

.config-list dt {
    color: var(--muted);
    font-weight: 700;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.card,
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem;
}

.panel {
    margin-bottom: 1rem;
}

.stat {
    display: grid;
    gap: .35rem;
}

.stat strong {
    font-size: 1.35rem;
}

.status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .82rem;
    font-weight: 800;
}

.status.aberta {
    color: #1d4ed8;
    background: var(--info-soft);
}

.status.aguardando_pagamento {
    color: var(--warning);
    background: var(--warning-soft);
}

.status.paga,
.status.livre {
    color: var(--success);
    background: var(--success-soft);
}

.status.paga_parcial {
    color: #7c3aed;
    background: #f1eaff;
}

.status.cancelada {
    color: var(--danger);
    background: var(--danger-soft);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: .75rem;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: #f8fafc;
    font-size: .8rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    align-items: end;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.form-grid .span-4 {
    grid-column: 1 / -1;
}

@media (max-width: 860px) {
    .login-panel,
    .grid.two,
    .grid.three,
    .grid.four,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .login-copy {
        min-height: 260px;
    }

    .form-grid .span-2,
    .form-grid .span-4 {
        grid-column: auto;
    }
}
