:root {
    --ink: #1f1c17;
    --muted: #9b927d;
    --line: #ece6d6;
    --accent: #b08d4f;
    --accent-ink: #8a6d38;
    --accent-soft: #f7f1e2;
    --bg: #f7f5f0;
    --surface: #ffffff;
    --danger: #b3413a;
    --danger-soft: #fbeceb;
    --ok: #3f7d55;
    --ok-soft: #eaf3ec;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(31, 28, 23, 0.04), 0 8px 24px -12px rgba(31, 28, 23, 0.12);
    --shadow-sm: 0 1px 2px rgba(31, 28, 23, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 20px 72px;
}

.center-wrap {
    max-width: 400px;
    margin: 10vh auto;
    padding: 0 20px;
}

.brand {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    color: var(--accent-ink);
    font-weight: 400;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

h1.brand { font-size: 1.7rem; }

h2 { font-size: 1rem; font-weight: 600; margin: 28px 0 10px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.84rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.topbar-meta a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}
.topbar-meta a:hover { color: var(--ink); }

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--ink);
}

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 11px 22px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s, opacity 0.15s, box-shadow 0.15s;
}

button:hover, .btn:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: var(--shadow); }
button:active, .btn:active { transform: translateY(0); }

button.secondary, .btn.secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover { background: var(--accent-soft); box-shadow: none; }

button.danger, .btn.danger { background: var(--danger); }

button.small, .btn.small {
    margin-top: 0;
    padding: 7px 14px;
    font-size: 0.78rem;
}

.error { color: var(--danger); margin-top: 12px; font-size: 0.88rem; }
.success { color: var(--ok); margin-top: 12px; font-size: 0.88rem; }
.hint { color: var(--muted); margin-top: 10px; font-size: 0.82rem; }
.notice {
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
    margin-top: 16px;
    color: var(--accent-ink);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 760px;
}

th, td {
    text-align: left;
    padding: 13px 10px;
    white-space: nowrap;
}

td { border-top: 1px solid var(--line); }

td.wrap-cell { white-space: normal; max-width: 220px; }

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 12px;
}

tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--accent-soft); }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge.pending { background: var(--accent-soft); color: var(--accent-ink); }
.badge.confirmed { background: var(--ok-soft); color: var(--ok); }
.badge.declined { background: var(--danger-soft); color: var(--danger); }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
}

.stat .num { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .label { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }

.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }

.link-box input {
    font-size: 0.78rem;
    color: var(--muted);
    min-width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
}

.hero { text-align: center; margin-bottom: 22px; }
.hero h1 { font-size: 1.9rem; }
.hero p { color: var(--muted); margin: 6px 0 0; font-size: 0.92rem; }

.seat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.seat-options label {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-weight: 400;
    transition: border-color 0.15s, background 0.15s;
}
.seat-options label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.seat-options input { width: auto; }

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.table-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px 20px;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .wrap { padding: 20px 14px 56px; }
    .card { padding: 18px; border-radius: 14px; }
    .table-card { padding: 4px 14px; }
    h1 { font-size: 1.25rem; }
    .hero h1 { font-size: 1.6rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .topbar { padding-bottom: 16px; }
}
