:root {
    --purple: #4a2c8f;
    --purple-dark: #3a2270;
    --cyan: #00bcd4;
    --bg: #f7f9fc;
    --card: #ffffff;
    --green: #2e7d32;
    --green-bg: #e6f4ea;
    --red: #c62828;
    --red-bg: #fdecea;
    --mine-bg: #e8eefc;
    --text: #1f2430;
    --muted: #6b7280;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex; align-items: center; gap: 24px;
    background: var(--purple); color: #fff;
    padding: 12px 20px;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; color: #fff; text-decoration: none; }
.topbar nav a { color: #d8d2f0; text-decoration: none; margin-right: 16px; }
.topbar nav a:hover { color: #fff; }

.container { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }

h1, h2 { color: var(--purple-dark); }

.card {
    background: var(--card); border-radius: 16px; padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 20px;
}

button, .btn {
    background: var(--purple); color: #fff; border: none;
    border-radius: 10px; padding: 10px 16px; font-size: .95rem;
    cursor: pointer;
}
button:hover { background: var(--purple-dark); }
button.secondary { background: var(--cyan); }
button.ghost { background: transparent; color: var(--purple); border: 1px solid var(--purple); }
button:disabled { opacity: .5; cursor: default; }

select, input {
    padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: .95rem;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }

.slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.slot {
    border-radius: 12px; padding: 12px; text-align: center;
    border: 1px solid transparent;
}
.slot.free   { background: var(--green-bg); border-color: #bfe3c6; }
.slot.reserved { background: var(--red-bg); border-color: #f4c7c3; }
.slot.mine   { background: var(--mine-bg); border-color: #c3d0f4; }
.slot.expired { background: #f0f0f0; border-color: #d0d0d0; opacity: .45; pointer-events: none; }
.slot .time { font-weight: 600; margin-bottom: 8px; }
.slot button { padding: 6px 10px; font-size: .85rem; width: 100%; margin-top: 4px; }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-box { background: #fff; padding: 14px; border-radius: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.1); }
.countdown { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f4; font-size: .9rem; }
th { color: var(--purple-dark); }

.modal-back {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: #fff; border-radius: 16px; padding: 24px; max-width: 380px; width: 100%; }
.hidden { display: none; }
