:root{
  --bg:#f4f6f8;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --brand:#0ea5e9;
  --brand2:#22c55e;
  --danger:#ef4444;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --radius: 14px;
  --cellH: 42px;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

.topbar{
  background:var(--card);
  border-bottom:1px solid var(--line);
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:44px;height:44px;border-radius:12px;
  display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand),#2563eb);
  color:#fff;font-weight:800;
}
.title{ font-weight:800; font-size:18px; }
.subtitle{ color:var(--muted); font-size:13px; }

.btn{
  border:1px solid var(--line);
  background:#fff;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{ border-color:#cbd5e1; }
.btn.primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.btn.danger{
  background:var(--danger);
  border-color:var(--danger);
  color:#fff;
}

.layout{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:16px;
  padding:16px;
}

.sidebar{ display:flex; flex-direction:column; gap:16px; }

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}

.cardTitle{
  font-weight:800;
  margin-bottom:10px;
}

.weekLabel{
  font-size:14px;
  color:var(--muted);
}
.hint{ margin-top:10px; color:var(--muted); font-size:13px; }

.muted{ color:var(--muted); }
.hidden{ display:none; }

.selection .selRow{
  display:flex; justify-content:space-between;
  margin:6px 0;
  font-size:14px;
}
.sep{ border:0; border-top:1px solid var(--line); margin:12px 0; }

label{ display:block; font-size:13px; margin:10px 0; color:var(--muted); }
input, textarea{
  width:100%;
  margin-top:6px;
  padding:10px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  outline:none;
}
input:focus, textarea:focus{ border-color:var(--brand); }

.msg{ margin-top:10px; font-size:13px; }

.content{ display:flex; flex-direction:column; gap:16px; }

.tabs{
  display:flex; gap:8px;
}
.tab{
  border:1px solid var(--line);
  background:#fff;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:700;
}
.tab.active{
  border-color:var(--brand2);
  box-shadow:0 0 0 3px rgba(34,197,94,.15);
}

.gridWrap{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.gridHeader{
  display:grid;
  grid-template-columns: 110px repeat(7, 1fr);
  border-bottom:1px solid var(--line);
  background:#f8fafc;
}
.gridHeader .hcell{
  padding:10px 10px;
  border-right:1px solid var(--line);
  font-weight:800;
  font-size:13px;
}
.gridHeader .hcell:last-child{ border-right:0; }

.grid{
  display:grid;
  grid-template-columns: 110px repeat(7, 1fr);
}

.timeCell{
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  height:var(--cellH);
  padding:10px;
  font-weight:800;
  font-size:12px;
  color:var(--muted);
  background:#fbfdff;
}

.slot{
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  height:var(--cellH);
  cursor:pointer;
  position:relative;
  background:#fff;
}
.slot:hover{ background:#f1f5f9; }

.slot.busy{
  background:rgba(239, 68, 68, .12);
  cursor:not-allowed;
}
.slot.busy:hover{ background:rgba(239, 68, 68, .14); }

.slot .badge{
  position:absolute;
  left:8px; right:8px; top:8px;
  font-size:12px;
  padding:6px 8px;
  border-radius:12px;
  background:rgba(239,68,68,.18);
  border:1px solid rgba(239,68,68,.25);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.legend .legRow{
  display:flex; align-items:center; gap:10px;
  margin:8px 0; color:var(--muted);
}
.chip{ width:16px; height:16px; border-radius:6px; border:1px solid var(--line); }
.chip.free{ background:#fff; }
.chip.busy{ background:rgba(239, 68, 68, .14); border-color:rgba(239, 68, 68, .25); }

.listCard .list{
  display:flex; flex-direction:column; gap:10px;
}
.item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.item .meta{ color:var(--muted); font-size:13px; }
.item strong{ display:block; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
}
/* Drag výběr slotů */
.slot{
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* důležité pro mobilní tažení */
}

.slot.sel{
  background: rgba(59, 130, 246, 0.14);
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.slot.closed{
  background: #f1f5f9;
  cursor: not-allowed;
}
.slot.closed:hover{
  background: #f1f5f9;
}
.slot.closed::after{
  content: "Nelze pronajmout";
  position: absolute;
  left: 8px;
  top: 10px;
  font-size: 11px;
  color: #94a3b8;
}

.slot.selecting {
    background: rgba(46, 204, 113, 0.4);
    border: 2px dashed #2ecc71;
}

.slot.selected {
    background: #2ecc71;
    color: #fff;
}
/* === Sjednocení vzhledu prvního sloupce (Čas) s ostatními === */
.timeCell{
  background:#fff;          /* místo #fbfdff */
  color: var(--muted);
  text-align:left;          /* nebo center, jak chceš */
}

/* i hlavička "Čas" ať sedí vizuálně */
.gridHeader .hcell:first-child{
  text-align:left;          /* nebo center */
}

/* === Responzivní mřížka: užší první sloupec + možnost scrollu === */
@media (max-width: 700px){
  .gridWrap{ overflow-x:auto; }
  .gridHeader, .grid{
    grid-template-columns: 78px repeat(7, minmax(86px, 1fr));
    min-width: 760px; /* aby se to na mobilu nerozpadlo, bude to scrollovat */
  }
}
