:root{
  --bg:#0b0f17;
  --card:#121a26;
  --muted:#8aa0b6;
  --text:#e7eef7;
  --line:#1b2a3f;
  --btn:#2d6cdf;
  --btn2:#1c2b40;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
}
.brand{font-weight:700}
.wrap{max-width:1400px;margin:18px auto;padding:0 14px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
  margin-bottom:14px;
}
h2,h3{margin:0 0 10px}
.row{display:flex;gap:10px;align-items:center;margin:8px 0}
.row label{min-width:160px;color:var(--muted)}
.row input,.row select{
  flex:1;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#0e1520;
  color:var(--text);
}
.row-inline{display:flex;gap:8px;align-items:center}
.row-inline label{color:var(--muted)}
.row-inline select,.row-inline input{
  padding:6px 8px;border-radius:8px;border:1px solid var(--line);
  background:#0e1520;color:var(--text);
}
.btn{
  padding:8px 12px;border-radius:10px;border:1px solid #2a4b86;
  background:var(--btn);color:white;cursor:pointer;font-weight:600;
}
.btn-secondary{background:var(--btn2);border-color:var(--line)}
.hidden{display:none}
.msg{margin-top:10px;color:#ffd38b}
.list{border:1px solid var(--line);border-radius:10px;padding:8px;background:#0e1520}
.list .item{display:flex;align-items:center;justify-content:space-between;padding:6px 6px;border-bottom:1px solid #162235}
.list .item:last-child{border-bottom:none}
.pill{padding:2px 8px;border-radius:999px;border:1px solid var(--line);color:var(--muted);font-size:12px}
.swatch{width:14px;height:14px;border-radius:4px;border:1px solid #0008;display:inline-block;margin-right:8px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.spacer{height:10px}

.toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:8px}
.hint{color:var(--muted);margin-bottom:10px}


/* Calendar */
.cal{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:12px;
  background:#0b1220;
}

/* lock the column widths so header + body match */
.weekHead,
.grid{
  display:grid;
  grid-template-columns: 90px repeat(7, minmax(120px, 1fr));
}

/* header */
.weekHead{
  background:#0e1520;
  border-bottom:1px solid var(--line);
}
.weekHead .cell{
  padding:10px 10px;
  border-right:1px solid var(--line);
  font-weight:700;
  height:56px;              /* fixed height prevents drift */
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
}
.weekHead .cell:last-child{border-right:none}

/* body grid */
.timeCell{
  padding:0 10px;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  color:var(--muted);
  background:#0e1520;
  height:24px;              /* MUST match slot height */
  display:flex;
  align-items:center;
  font-size:13px;
}

.slot{
  position:relative;
  height:24px;              /* MUST match timeCell height */
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:#0b1220;
  cursor:pointer;
}

.slot.dim{opacity:0.55}

.slot .fill{
  position:absolute;
  left:0; top:0; bottom:0;
  width:0%;
  border-radius:0;          /* makes it look like a real block */
}

.slot.booked{cursor:default}
.slot.booked .fill{opacity:0.9}

/* Make the week blocks not add random borders */
.week{
  border-bottom:1px solid var(--line);
}
.week:last-child{border-bottom:none}

/* tighten the “pill” so it doesn’t change header height */
.pill{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  width:max-content;
}

/* Right-click menu */
.ctx{
  position:fixed;
  z-index:9999;
  min-width:220px;
  background:#0e1520;
  border:1px solid var(--line);
  border-radius:10px;
  padding:6px;
  box-shadow:0 10px 30px #0008;
}
.ctx .mitem{
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  color:var(--text);
}
.ctx .mitem:hover{background:#12233b}
.ctx .sep{height:1px;background:var(--line);margin:6px 0}
.ctx .small{color:var(--muted);font-size:12px;padding:4px 10px}
