:root {
    --bg: #f6f1e8;
    --card: #ffffff;
    --accent: #124d4d;
    --accent-light: #e6f1ef;
    --text: #2c2b28;
    --muted: #6d6a63;
    --border: #d7d2c7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Verdana", "Geneva", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #fdfbf6 0%, #f2eadc 45%, #e7dccb 100%);
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.page.wide {
    max-width: 1200px;
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.page-header p {
    color: var(--muted);
    max-width: 620px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 16px 30px rgba(48, 38, 20, 0.08);
}

.grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.form-row {
    display: grid;
    gap: 12px;
    align-items: end;
    grid-template-columns: minmax(220px, 1fr) auto;
}

.stack {
    display: grid;
    gap: 12px;
}

label {
    font-weight: 600;
}

input,
select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

button {
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #0b3b3b;
}

.alert {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
}

.alert.success {
    background: #e1f0ea;
    color: #0f5132;
}

.alert.error {
    background: #f7e1df;
    color: #842029;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    padding: 12px 18px;
    border-radius: 12px;
    background: #0f5132;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.hint {
    color: var(--muted);
}

.qr-hint {
    text-align: center;
    font-size: 0.9rem;
}

.selected {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: var(--card);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 16px 30px rgba(48, 38, 20, 0.08);
}

.main-header-left {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
}

.main-header-left a {
    color: inherit;
    text-decoration: none;
}

.main-header-left a:hover,
.main-header-left a:focus {
    text-decoration: underline;
}

.main-header-right {
    text-align: right;
    font-weight: 600;
}

.main-header-right .event-name {
    display: block;
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 2px;
}

.main-header-right .time {
    display: block;
    font-size: 1.2rem;
    color: var(--accent);
}

.bon-row {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
}

.entry-panel {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
}

.entry-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.entry-field {
    display: grid;
    gap: 8px;
}

.entry-hint {
    color: var(--muted);
    font-weight: 600;
}

.bon-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.columns {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.panel {
    min-height: 220px;
    background: var(--card);
    border-radius: 16px;
    border: 1px dashed var(--border);
    padding: 18px;
    color: var(--muted);
}

.panel-title {
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-count {
    font-weight: 700;
    color: var(--muted);
    text-align: right;
}

.qr-code {
    display: block;
    width: 200px;
    max-width: 100%;
    margin: 8px auto 12px;
}

.sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f4ed;
    color: var(--text);
    font-weight: 600;
}

.sum-value {
    font-weight: 700;
    color: var(--accent);
    text-align: right;
    font-size: 1.5rem;
}

.change-block {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f4ed;
    color: #4a4a4a;
}

.change-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.change-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: 0.95rem;
}

.change-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.change-label {
    text-align: left;
}

.change-value {
    text-align: right;
    font-weight: 600;
}

.position-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: 0.8rem;
}

.position-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    background: #f7f4ed;
    color: var(--text);
}

.position-label {
    font-weight: 600;
}

.position-price {
    font-weight: 700;
    color: var(--accent);
}

.delete-btn {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-weight: 700;
    width: 28px;
    height: 28px;
    padding: 0;
}

.delete-btn:hover {
    background: #f3e7e5;
    color: #842029;
}

@media (max-width: 700px) {
    .page-header h1 {
        font-size: 2.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-header-right {
        text-align: left;
    }

    .bon-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .entry-form {
        grid-template-columns: 1fr;
    }

    .columns {
        grid-template-columns: 1fr;
    }
}
