﻿:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #16a34a;
  --taken: #e5e7eb;
  --border: #e5e7eb;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
.head { text-align: center; margin: 16px 0 24px; }
.head h1 { margin: 0; font-size: 1.6rem; }
.sub { margin: 4px 0 0; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; text-align: left; }

.controls { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.controls label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 4px; flex: 1; min-width: 130px; }
select, input, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.status { color: var(--muted); min-height: 1.2em; margin: 6px 2px; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot {
  padding: 14px 8px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; cursor: pointer; font-size: .9rem; transition: .15s;
}
.slot:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 2px 8px rgba(37,99,235,.15); }
.slot.taken { background: var(--taken); color: #9ca3af; text-decoration: line-through; cursor: not-allowed; }
.slot.past { background: #fafafa; color: #c0c4cc; cursor: not-allowed; }

.legend { margin-top: 20px; color: var(--muted); font-size: .82rem; display: flex; gap: 16px; align-items: center; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.dot.free { background: #fff; border: 1px solid var(--brand); }
.dot.taken { background: var(--taken); }

.modal {
  position: fixed; inset: 0; background: rgba(17,24,39,.5);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal.open { display: flex; }
.card {
  background: var(--card); border-radius: 16px; padding: 22px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.card.wide { max-width: 560px; }
.card.center { text-align: center; }
.card h2 { margin: 0 0 14px; font-size: 1.2rem; }
.card label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.slotpick { color: var(--muted); margin: -4px 0 14px; }
.row { display: flex; gap: 10px; margin-top: 6px; }
.row .primary, .row .ghost { flex: 1; }

.primary {
  background: var(--brand); color: #fff; border: 0; padding: 11px 16px;
  border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--brand-dark); }
.primary:disabled { opacity: .6; cursor: default; }
.ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--border);
  padding: 11px 16px; border-radius: 10px; font: inherit; cursor: pointer;
}
.link { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; text-decoration: underline; }

.token { font-size: 2.6rem; font-weight: 800; color: var(--brand); margin: 8px 0; }
.muted { color: var(--muted); }
.err { color: var(--danger); min-height: 1em; margin: 4px 0; }
.ok { color: var(--ok); min-height: 1em; margin: 4px 0; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font: inherit; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: .88rem; white-space: nowrap; }
.tbl th { background: #f9fafb; color: var(--muted); font-weight: 600; }
